win,fs: use the new Windows fast stat API#4327
Conversation
|
Looks like the kernel API for this was added in Windows 10, version 1703 circa 2017 (EOL 2019), though not documented until circa 10/30/2019 https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/nf-ntifs-ntqueryinformationbyname |
|
The version number where this exact feature is supposed to be available starting in Windows 11 doesn't exist yet and/or isn't released yet, depending on which documentation page you go by: But looks like python has been using this API since about 1 year ago, when it was added for them: At a cursory glance, this looks great |
|
@vtjnash thank you for your suggestion. The kernel API for this is available as of Windows 11, build 26048. The API I use an API function This is already available in Windows Insiders, which I have been using for testing. |
|
Okay, it looks like 24H2 is 26052, which is consistent with the documentation saying >= 26048, released recently: |
28e162a to
a262013
Compare
|
Rebased to include the sanitizer test fix. I see a new failure on macOS, I believe that's not related to the changes here. |
|
@vtjnash is there anything else I can do to help here? |
|
I think it is ready to go, I just figure it will get merged in a batch sometime before the next release |
|
Hi @vtjnash, I was just wondering when this will land and be released. Is there a plan for the releases? Thanks in advance. |
|
Do you mind rebasing (or ticking the checkbox to give me the ability to do that) and fixing the one style nit? It looks all ready to merge, as we get ready for the next release, but I wouldn't mind giving it one more CI test run. |
Co-authored-by: Jameson Nash <vtjnash@gmail.com>
1b51cd0 to
3e8f3a9
Compare
|
Thank you for the review. I've applied the change and rebased the branch. |
Windows added a new API for file information, which doesn't have to open the file thus greatly improving performance: https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getfileinformationbyname .
This PR implements this improvement on libuv. This was based on the Python implementation: https://github.com/python/cpython/blob/3a72fc36f93d40048371b789e32eefc97b6ade63/Modules/posixmodule.c#L2089-L2120 .
The stat functions are already covered by tests, so no test was added here. I considered comparing the result of old and new code, but that would require exposing internal fs functions, and we would be testing Windows functionality, not libuv.