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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_Get_any_status(__Path, __std_fs_stats_flags::_Attributes | __std_fs_stats_flags::_Reparse_tag) calls to many WinAPI functions for regular files or directories. It calls GetFileAttributesEx + CreateFile + GetFileInformationByHandleEx(FileBasicInfo) but GetFileAttributesEx is enough to get all needed data if it is known that a file is not a reparse point.
This problem affects symlink_status performance.
Benchmark symlink_status results before changes:
---------------------------------------------------------
Benchmark Time CPU Iterations
---------------------------------------------------------
symlink_status 15376 ns 15346 ns 44800
Benchmark symlink_status results after changes:
---------------------------------------------------------
Benchmark Time CPU Iterations
---------------------------------------------------------
symlink_status 2219 ns 2148 ns 320000
Thanks! On my system (5950X, 24H2, Samsung SSD 980 PRO), I observe much less of a performance improvement, but still major: 21126 ns => 10098 ns, for a speedup of 2.1x.
Thanks! On my system (5950X, 24H2, Samsung SSD 980 PRO), I observe much less of a performance improvement, but still major: 21126 ns => 10098 ns, for a speedup of 2.1x.
Thank you too!
Yes, performance improvement depends on filesystem minifilter drivers configuration.
For example, for paths on system drive GetFileAttributes works much slower than for paths from other drives.
StephanTLavavej
changed the title
Improve symlink_status performance<filesystem>: Improve symlink_status performance
Nov 12, 2024
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
_Get_any_status(__Path, __std_fs_stats_flags::_Attributes | __std_fs_stats_flags::_Reparse_tag)
calls to many WinAPI functions for regular files or directories. It callsGetFileAttributesEx
+CreateFile
+GetFileInformationByHandleEx(FileBasicInfo)
butGetFileAttributesEx
is enough to get all needed data if it is known that a file is not a reparse point.This problem affects
symlink_status
performance.Benchmark
symlink_status
results before changes:Benchmark
symlink_status
results after changes: