-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Using GetFileInformationByName in Windows for file stat/metadata operations #130169
Copy link
Copy link
Open
Labels
A-filesystemArea: `std::fs`Area: `std::fs`C-optimizationCategory: An issue highlighting optimization opportunities or PRs implementing suchCategory: An issue highlighting optimization opportunities or PRs implementing suchI-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.O-windowsOperating system: WindowsOperating system: WindowsT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-filesystemArea: `std::fs`Area: `std::fs`C-optimizationCategory: An issue highlighting optimization opportunities or PRs implementing suchCategory: An issue highlighting optimization opportunities or PRs implementing suchI-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.O-windowsOperating system: WindowsOperating system: WindowsT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Continuing discussion from #128256...
Currently, window's fs.rs uses the
GetFileInformationByHandleapi which requires opening and closing a file handle. A new API will be available in future builds of Windows (from documentation it should be around 24H2/26052) calledGetFileInformationByNamewhich does not require opening a file handle. This reduces 2-3 syscalls in this code path which can have a reasonable performance gain.There are a few design considerations however,
#[cfg(not(target_vendor = "win7")] )Currently, this change would support tier-1 support for #121478 since it includes all the fields needed in one call. In addition to removing the additional syscall for handling reparse points.
Prior Art:
Links:
cc: @ChrisDenton