Overview
| Artifact ID: | d2b05904443540f72dde50cede03aed062337984187b7a509c15289e90425eaf |
|---|---|
| Ticket: | 411f52ed87e313dd49e292a77f231b8f7d09e94d
file performance on windows is slow depending on path vs string rep |
| User & Date: | juliannoble2 on 2023-08-20 12:15:44 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-fossil-plain"
- comment changed 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 changed to: "8.6,8.7,9"
- is_private changed to: "0"
- login: "juliannoble2"
- priority changed to: "5 Medium"
- private_contact changed to: "957fdfcd8744611e3fe1f4896c7538b1d9bf47b2"
- resolution changed to: "None"
- severity changed to: "Severe"
- status changed to: "Open"
- submitter changed to: "juliannoble2"
- subsystem changed to: "37. File System"
- title changed to:
file performance on windows is slow depending on path vs string rep
- type changed to: "Bug"