<i>glob on case insentitive sytems not respecting character class case</i> status still Open with 3 other changes
by
.
D 2026-03-28T05:02:28.522
J comment related\sbut\sI\ssuspect\sdifferent\sto\shttps://core.tcl-lang.org/tcl/tktview/108904173c\r\n\r\nAn\sexample\son\swindows\sc:/windows/system32\sfolder\s(which\sis\sone\sof\sthe\slargest\sdefault\sdirectories\son\sa\swindows\ssystem)\r\n\r\n\s\s%llength\s[glob\s{[a]*}]\r\n\s\s246\r\n\s\s%llength\s[glob\s{[A]*}]\r\n\s\s246\r\n\s\s%llength\s[glob\s{[aA]*}]\r\n\s\s246\r\n\r\nI\shave\san\salternative\scommand\sfglob\sthat\sI\simplemented\susing\stwapi\sthat\scan\sproduce\scorrect\sresults.\r\n\r\n\s\s%llength\s[fglob\s{[a]*}]\r\n\s\s118\r\n\s\s%llength\s[fglob\s{[A]*}]\r\n\s\s128\r\n\s\s%llength\s[fglob\s{[aA]*}]\r\n\s\s246\r\n\r\nI\sexpect\son\sa\scase-insensitve\ssystem\sthat\scharacters\soutside\seither\scharacter\sclasses\sor\sbraced-alternative\sglobs\sshould\sbe\scase-insensitive,\sbut\scharacter\sclasses\ssuch\sas\s[a-z]\s[A-Z]\sshould\sbe\srespect\sthe\scase\sof\sthe\sfile\sas\sstored\son\sthe\ssystem\s-\swhich\sis\sclearly\spossible\sto\sdo,\sand\sat\sleast\sin\sthe\scases\sI\stested\s-\spretty\sperformantly.\r\n\r\nAs\sa\sside\snote\s-\smy\swrapper\sis\susing\stcl\sscript\sand\stwapi\sbut\sno\sother\sc\scode\s-\sand\sis\sunderstandably\sslower\son\smany\ssimple\squeries\ssuch\sas\s*,\sit\scan\soutperform\sthe\sbuiltin\sglob\son\ssome\sof\sthe\smore\scomplex\sglob\squeries.\r\n\s\s\r\n\s\s%time\s{glob\s{[a]*}}\r\n\s\s9444\smicroseconds\sper\siteration\r\n\r\n\s\s%time\s{fglob\s{[aA]*}}\r\n\s\s3164\smicroseconds\sper\siteration\r\n\s\s%time\s{fglob\s{[a]*}}\r\n\s\s1820\smicroseconds\sper\siteration\r\n\r\nThis\ssuggests\sthat\sthere\smay\sbe\sjustification\sfor\sre-examining\sthe\smechanisms\sbeing\sused\shere\s-\salthough\sI\sdon't\sclaim\sto\sknow\sall\sthe\stradeoffs\sthat\scould\sbe\srequired\sto\spreferably\soptimise\sfor\ssimple\scases.\r\n\r\nI\swould\sexpect\smy\stcl/twapi\salternative\sto\sbe\sslower\sin\sall\scases.\r\n\r\nThe\sdifference\sis\slarge\senough\sthat\sI\sdon't\sthink\sit's\srelated\sto\sany\sside\sissues\ssuch\sas\soption\sparsing\sor\schecking\sfor\svfs\setc\s(which\sI\salso\sdo\sanyway)\r\nMy\sfglob\salso\shandles\sbraced\sexpressions\s(even\snested)\sand\sgenerates\sfairly\scomplex\sregexps\sto\spost-process\sthe\sresult\sfrom\snecessarily\sbroader\squeries\sthat\sthe\sunderlying\swindows\ssystem\saccepts\s(only\s*\sand\s?\sglobs).\r\n\r\nWhilst\sI\shaven't\sset\sup\stests\sto\sverify\smy\sfglob\ssupports\sall\spossible\svalid\sglobs\s(e.g\sprocessing\sescaped\sglob\scharacters\sin\sall\slevels\sof\snesting)\sthe\stime\sdifference\sis\sstill\sa\sbit\ssuspicious\sto\sme,\sand\sthe\ssimple\scases\sabove\sshould\sbe\sfaster\sregardless\sof\sglob\sexpression\sprocessing\sor\spost-retrieval\sfiltering\swhich\sI\swouldn't\sexpect\sto\sdominate.\r\n\r\nMy\stime\stests\sare\son\sa\smodern\sfast\snvme\sssd\s-\sso\sI\scan't\ssuggest\sthat\smy\sglob\svs\sfglob\stimings\sabove\sare\sindicative\sfor\sspinning\srust\ssystems,\salthough\stesting\son\sa\smapped\snetwork\sdrive\sfrom\sa\sshare\son\sa\sremote\ssystem\sthe\sfglob\sversion\swas\sstill\ssignificantly\sfaster\sthan\sglob\sfor\sthose\sbasic\scharacter-class\squeries.
J login juliannoble2
J mimetype text/plain
K a382a311e098c19ae3abe371602eb84d7a1e00e6
U juliannoble2
Z ebdf2ecee78d1c158212faed76f509ca