[vim/vim] patch 9.2.NNNN: file status checks are slow on MS-Windows (PR #21446)

7 views
Skip to first unread message

mattn

unread,
Oct 4, 2026, 10:10:05 AM (2 days ago) Oct 4
to vim/vim, Subscribed

Windows file status checks currently call FindFirstFileW() to identify symbolic links before falling back to _wstat64(), even for ordinary files and missing paths. This adds directory queries to glob(), globpath(), and runtime/autoload searches.

Check GetFileAttributesW() first and query the reparse tag only for reparse points. Keep the existing CRT stat path for ordinary files and failed attribute queries, and retain the existing symbolic-link handling. Add coverage for literal symlink paths, dangling links, and directory junctions.

On a local Windows setup, a missing-file glob() benchmark improved from about 86 to 57 microseconds per call, and an existing-file glob() from 95 to 80 microseconds (3,000 calls each). Five paired startup runs with identical runtime scripts gave medians of 354 ms before and 334 ms after. Both startup binaries included a separate executable() optimization; this PR contains only the stat change and does not depend on that optimization.

Validation: MinGW-w64 console build with no new warnings; relevant glob/filewritable tests, test_stat.vim, and test_file_perm.vim passed (14 passed, 3 platform/feature skips), including a rebuild and rerun with this commit isolated. Results for 27 special-path cases matched before and after. A broader earlier run also passed resolve_win32; two executable tests failed identically with the pre-change binary and are unrelated to this change. git diff --check passed.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/21446

Commit Summary

  • 8f0076d patch 9.2.NNNN: file status checks are slow on MS-Windows

File Changes

(2 files)

Patch Links:

—
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.Message ID: <vim/vim/pull/21446@github.com>

Reply all
Reply to author
Forward
0 new messages