<i>file performance on windows is slow depending on path vs string rep</i>.
by
.
D 2023-08-20T12:15:44.943
J assignee nobody
J closer nobody
J cmimetype text/x-fossil-plain
J comment Filesystem\saccess\ssuch\sas\sglob,\sfile\sattributes,\sfile\snormalize\shas\sbeen\sslow\son\swindows\sfor\sa\slong\stime\sin\s8.6/8.7\scompared\sto\ssay\sFreeBSD\s-\sbut\scould\sbe\sworked\saround\ssomewhat\sby\seither\susing\sTwapi\s(which\sthen\swould\sneed\sscript\sto\sfall\sback\sto\sother\smethods\swhen\sunder\svfs\smounts)\s\sor\sby\scarefully\spreserving\sinternal\spath\srep\sof\sa\spath\sand\sdoing\sno\sstring\soperations\son\sit.\r\nThese\sworkarounds\saren't\sa\sreal\ssolution\sand\sshouldn't\sneed\sto\sbe\sdone\sto\sget\sdecent\sfilesystem\sperformance.\s\r\n\r\nTcl\s9\s(tested\son\sa\sbuild\sfrom\s2023-08)\sexhibits\sthe\ssame\sslowness\sbut\susing\s[file\sjoin\s$path\ssubfolder]\s\sno\slonger\sgives\sany\sperformance\sbenefit\sover\s$path/subfolder\smaking\sthe\ssituation\sworse.\r\n\r\nHere\sis\sa\stypical\stiming\sfor\sglob\sin\s8.6/8.7\sof\sa\snon-existant\ssubfolder\r\nP%\stime\s{glob\s-nocomplain\s-dir\s[file\sjoin\s$x\s1234]\s*}\r\n-\s\s239\smicroseconds\sper\siteration\r\nP%\stime\s{glob\s-nocomplain\s-dir\s$x/1234\s*}\r\n-\s\s1193\smicroseconds\sper\siteration\r\n\r\nHere\sis\sthe\ssame\sdone\son\sTcl\s9\r\n\r\n%\stime\s{glob\s-nocomplain\s-dir\s[file\sjoin\s$x\s1234]\s*}\r\n1137\smicroseconds\sper\siteration\r\n%\stime\s{glob\s-nocomplain\s-dir\s$x/1234\s*}\r\n1083\smicroseconds\sper\siteration\r\n\r\n200\smicroseconds\sis\sthe\smore\sreasonable\svalue\s-\snone\sof\sthese\sshould\sbe\sup\saround\sthe\sms\smark.\r\n\r\nPossibly\srelated\s-\sagain\stimings\sfor\s8.6/8.7\sfirst:\r\nP%\stime\s{set\sx\s[pwd]}\r\n-\s\s17\smicroseconds\sper\siteration\r\nP%\stime\s{set\ssub\s[file\sjoin\s$x\smodules]}\r\n-\s\s15\smicroseconds\sper\siteration\r\nP%\stime\s{file\snormalize\s$sub}\r\n-\s\s151\smicroseconds\sper\siteration\r\nP%\r\nP%\r\nP%\stime\s{set\sx\s[pwd]}\r\n-\s\s6\smicroseconds\sper\siteration\r\nP%\stime\s{set\ssub\s[file\sjoin\s$x\smodules]}\r\n-\s\s7\smicroseconds\sper\siteration\r\nP%\sstring\slength\s$x\r\n-\s\s23\r\nP%\stime\s{file\snormalize\s$sub}\r\n-\s\s919\smicroseconds\sper\siteration\r\n\r\nNote\sthe\ssensitivity\sto\susing\s$x\sas\sa\sstring\sin\sbetween\scalls.\r\n\r\nFor\stcl9\s-\seven\swithout\susing\sthe\spath\sas\sa\sstring\s-\sthe\snormalize\scall\sis\sslow:\r\n\r\n%\stime\s{set\sx\s[pwd]}\r\n10\smicroseconds\sper\siteration\r\n%\stime\s{set\ssub\s[file\sjoin\s$x\smodules]}\r\n13\smicroseconds\sper\siteration\r\n%\stime\s{file\snormalize\s$sub}\r\n1132\smicroseconds\sper\siteration\r\n\r\n\r\nThese\stimings\sbecome\sproblematic\sfor\scode\sthat\swalks\sthe\slocal\sfilesystem\seven\son\sSSDs\sand\sbecome\spathological\sover\seven\sa\sfast\sfibreoptic\snetwork\sto\snetwork\sshares.\s\r\n\r\nPerhaps\salso\srelated\sis\sthe\sslowness\sof\s'file\sattributes'\son\swindows,\s(which\smay\sbe\srelated\sto\sgathering\sthe\swindows\s-shortname\sfield?)\r\n\r\nThese\scalls\sare\sconsistently\sover\s1ms\s-\swhereas\stimings\son\sFreeBSD\ssuggest\sit\sshould\sbe\son\sthe\sorder\sof\slow\shundreds\sof\suS\s(and\stwapi\scan\sgather\sit\sin\sin\s200us\sor\sso)\r\n\r\nEven\sif\scode\sis\sadded\sto\stest\sthat\sthe\spath\sisn't\sbelow\sa\sVFS\smount\spoint\s-\sit\sshouldn't\sadd\sup\sto\sthese\ssorts\sof\sdelays.
J foundin 8.6,8.7,9
J is_private 0
J login juliannoble2
J priority 5\sMedium
J private_contact 957fdfcd8744611e3fe1f4896c7538b1d9bf47b2
J resolution None
J severity Severe
J status Open
J submitter juliannoble2
J subsystem 37.\sFile\sSystem
J title file\sperformance\son\swindows\sis\sslow\sdepending\son\spath\svs\sstring\srep
J type Bug
K 411f52ed87e313dd49e292a77f231b8f7d09e94d
U juliannoble2
Z 8d408fccab49cf3aa8efca5d73403103