Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve stat performance on Windows #203

Open
wolfs opened this issue May 4, 2020 · 0 comments
Open

Improve stat performance on Windows #203

wolfs opened this issue May 4, 2020 · 0 comments

Comments

@wolfs
Copy link
Member

wolfs commented May 4, 2020

The PR #37 switched from using GetFileAttributesExW to GetFileInformationByHandle for symlink support. This seems to be much slower.

The same issue seems to have appeared in Visual Studio: dotnet/msbuild#2052

There, they fixed this in dotnet/msbuild#2087 by first calling GetFileAttributesExW, and then falling back to use GetFileInformationByHandle only if the target is actually a symlink.

The JMH benchmark in the native subproject of gradle/gradle shows the difference:

Latest native platform, Windows 10 (from gradle/gradle#12966 (comment)):
image

Old benchmark result from 2017 (from gradle/gradle#1183 (comment)):

image

Java NIO seems to be using GetFileAttributesW, and I think that is the only explanation for the much higher performance.

wolfs added a commit that referenced this issue Jul 17, 2021
for performance reasons when stating non-symlinks.
See #203
wolfs added a commit that referenced this issue Jul 17, 2021
for performance reasons when stating non-symlinks.
See #203
@lptr lptr removed the @execution label Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants