Open
Description
Continuing discussion from #128256...
Currently, window's fs.rs uses the GetFileInformationByHandle
api 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) called GetFileInformationByName
which 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,
- Not all file-system drivers support this API, for example FAT32
- Backwards compatibility stops at 1709, i.e. (basically this feature would be
#[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:
- GetInformationByHandle - https://learn.microsoft.com/windows/win32/api/winbase/nf-winbase-getfileinformationbyname
- Blog post - https://blogs.windows.com/windows-insider/2024/02/08/announcing-windows-11-insider-preview-build-26052-canary-and-dev-channels/
cc: @ChrisDenton