getfsize() calls mch_stat() and then queries the same path again with mch_isdir(). Use the directory type already returned in st_mode instead. This change is independent of the Windows stat and glob optimizations.
Add coverage for directory symlinks, trailing separators, files reached through a symlink, and deleted targets.
Validation: standalone MinGW-w64 build without warnings; four relevant test_stat tests pass. With the existing Windows optimizations combined, seven relevant tests pass and results for 27 special paths match the previous binary.
On Windows, five batches of 2,000 calls gave median times of 40.8 to 26.6 microseconds for an existing file and 41.1 to 25.3 microseconds for a directory. These measurements compare combined builds differing only in this change. Startup medians over seven runs were 275 and 273 ms, which does not establish a meaningful startup improvement.
https://github.com/vim/vim/pull/21448
(2 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()