You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #131972 - klensy:FindFirstFileExW, r=ChrisDenton
speedup directory traversal on windows
Optimizes walking over dirs on windows by replacing `FindFirstFileW` with `FindFirstFileExW` with `FindExInfoBasic` option, that allows skipping filling unused struct field which should be faster.
Also adds the same change for fallback call of `FindFirstFileExW` in metadata call.
Locally shows small speedup, but bench results from other users are welcome.
let find_handle = c::FindFirstFileW(path.as_ptr(),&mut wfd);
1050
+
letmut wfd: c::WIN32_FIND_DATAW = mem::zeroed();
1051
+
// this is like FindFirstFileW (see https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-findfirstfileexw),
1052
+
// but with FindExInfoBasic it should skip filling WIN32_FIND_DATAW.cAlternateFileName
1053
+
// (see https://learn.microsoft.com/en-us/windows/win32/api/minwinbase/ns-minwinbase-win32_find_dataw)
1054
+
// (which will be always null string value and currently unused) and should be faster.
1055
+
//
1056
+
// We can pass FIND_FIRST_EX_LARGE_FETCH to dwAdditionalFlags to speed up things more,
1057
+
// but as we don't know user's use profile of this function, lets be conservative.
0 commit comments