Artifacts Associated With Ticket 411f52ed87e313dd49e2
Ticket change [d2b0590444] (rid 217263) by juliannoble2 on 2023-08-20 12:15:44:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-plain"
- comment initialized to:
Filesystem access such as glob, file attributes, file normalize has been slow on windows for a long time in 8.6/8.7 compared to say FreeBSD - but could be worked around somewhat by either using Twapi (which then would need script to fall back to other methods when under vfs mounts) or by carefully preserving internal path rep of a path and doing no string operations on it. These workarounds aren't a real solution and shouldn't need to be done to get decent filesystem performance. Tcl 9 (tested on a build from 2023-08) exhibits the same slowness but using [file join $path subfolder] no longer gives any performance benefit over $path/subfolder making the situation worse. Here is a typical timing for glob in 8.6/8.7 of a non-existant subfolder P% time {glob -nocomplain -dir [file join $x 1234] *} - 239 microseconds per iteration P% time {glob -nocomplain -dir $x/1234 *} - 1193 microseconds per iteration Here is the same done on Tcl 9 % time {glob -nocomplain -dir [file join $x 1234] *} 1137 microseconds per iteration % time {glob -nocomplain -dir $x/1234 *} 1083 microseconds per iteration 200 microseconds is the more reasonable value - none of these should be up around the ms mark. Possibly related - again timings for 8.6/8.7 first: P% time {set x [pwd]} - 17 microseconds per iteration P% time {set sub [file join $x modules]} - 15 microseconds per iteration P% time {file normalize $sub} - 151 microseconds per iteration P% P% P% time {set x [pwd]} - 6 microseconds per iteration P% time {set sub [file join $x modules]} - 7 microseconds per iteration P% string length $x - 23 P% time {file normalize $sub} - 919 microseconds per iteration Note the sensitivity to using $x as a string in between calls. For tcl9 - even without using the path as a string - the normalize call is slow: % time {set x [pwd]} 10 microseconds per iteration % time {set sub [file join $x modules]} 13 microseconds per iteration % time {file normalize $sub} 1132 microseconds per iteration These timings become problematic for code that walks the local filesystem even on SSDs and become pathological over even a fast fibreoptic network to network shares. Perhaps also related is the slowness of 'file attributes' on windows, (which may be related to gathering the windows -shortname field?) These calls are consistently over 1ms - whereas timings on FreeBSD suggest it should be on the order of low hundreds of uS (and twapi can gather it in in 200us or so) Even if code is added to test that the path isn't below a VFS mount point - it shouldn't add up to these sorts of delays. - foundin initialized to: "8.6,8.7,9"
- is_private initialized to: "0"
- login: "juliannoble2"
- priority initialized to: "5 Medium"
- private_contact initialized to: "957fdfcd8744611e3fe1f4896c7538b1d9bf47b2"
- resolution initialized to: "None"
- severity initialized to: "Severe"
- status initialized to: "Open"
- submitter initialized to: "juliannoble2"
- subsystem initialized to: "37. File System"
- title initialized to:
file performance on windows is slow depending on path vs string rep
- type initialized to: "Bug"
Ticket change [25e87384d1] (rid 217290) by juliannoble2 on 2023-08-22 19:28:32:
- icomment:
Verified with sysinternals process monitor that the file commands are walking up the file hierarchy and querying each directory for information. In the case of Tcl9 - it's doing so twice for a single 'file attr' call - which is a regression from 8.7 I still believe this walking up the tree is related to gathering the 'shortname' info for windows paths. This information is useful if you're deep in a hierarchy - but I think most file operations make no use of it. It should probably be an explicit operation to gather it for a full path if required - or it should be cached, or only gathered automatically when there is an error related to long paths or windows-illegal characters in filenames. This walking up the tree affects other operations such as package loading and attempting to shell out to an unknown command (which on my system has a lag of 4s everytime I finger-fumble - versus nearly instantaneous on Unix) These operations were also checked with process monitor and the extra filesystem activity is visible.
- login: "juliannoble2"
- mimetype: "text/plain"
- icomment:
Ticket change [c408f2be97] (rid 217295) by oehhar on 2023-08-23 08:08:28:
- icomment:
Dear Julian, thank you for the ticket and the great analysis. I hope, Ashok will look into this. AFAIK, he did the great windows file reform to access long paths. As he did other great optimizations, this may also happen. Take care, Harald
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- username: "oehhar"
- icomment:
Ticket change [c66a096da4] (rid 217346) by apnadkarni on 2023-08-25 12:56:54:
- icomment:
Harald, I haven't worked on the file path related code except tilde removal. I certainly have not added any long path support I'm afraid and afaik neither has anyone else! May be at some point after 9.0, but in my opinion the code is too fragile for anyone to risk touching it before 9.0 ships. /Ashok
- login: "apnadkarni"
- mimetype: "text/plain"
- icomment:
Ticket change [7c3312a269] (rid 217347) by oehhar on 2023-08-25 13:12:34:
- icomment:
Ok, Ashok, thank you for your valuable opinion and sorry to "blame" you. Neverhteless, I can not understand where the change is coming from. From the description, it is told, that the cacheing of the native file path is apparently broken in TCL 9. Performance is anyway a point, we may attack if the beta is out. Nevertheless, this is serious. Thank you and take care, Harald
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- username: "oehhar"
- icomment:
Ticket change [b15bec97e5] (rid 217348) by apnadkarni on 2023-08-25 13:21:08:
- icomment:
Harald, I agree the performance regression is important and needs to be looked at. I was referring more to the long path support. /Ashok
- login: "apnadkarni"
- mimetype: "text/plain"
- icomment:
Ticket change [0107826fce] (rid 233437) by oehhar on 2024-09-14 17:10:06:
- icomment:
Julien wrote, that this ticket is related: [02d5d65d70adab97].
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- username: "oehhar"
- icomment:
Ticket change [1242ce4a4d] (rid 234177) by sebres on 2024-10-09 08:52:19:
- closedate changed to: "2460592.8696662"
- closer changed to: "sebres"
- icomment: "Seems to be fixed in [02d5d65d70adab97]."
- login: "sebres"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"