-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Consider walking directories in up-to-date checks #3586
Comments
@ccastanedaucf can you take a look at implementing this? Might help get Windows closer to Linux after #3547 is in. |
Would be nice if you could implement it over the existing IFileSystem :) Also, this might be a very good use case for the fast allocation free directory enumeration introduced by @JeremyKuhne https://blogs.msdn.microsoft.com/jeremykuhne/2018/03/09/custom-directory-enumeration-in-net-core-2-1/ |
The above problems are a huge burden in some dotnet repos see #2843 |
@4creators This will probably help with that, but I'd be shocked if it was a very high percentage of the overall incremental build time in those repos. |
@cdmihai small bench comparing methods of getting last write time for 10 files on Windows. Right now we use the equivalent of
|
Allocations would be interesting to measure as well. Using DirectoryInfo requires allocating a FileSystemInfo around every result, which will also allocate strings to do so. With FileSystemEnumerable you can get zero allocations (outside of the enumerable itself). |
1000 files in same directory + memory allocations. Looks like
|
Cool. Shows a pretty big difference. :) I'm curious about the Allocated (1.71K) number. Is it measuring |
#3608 is an implementation of this that should be revisited if we move forward with this bug. |
Another possible implementation to help with this: #2848; it should also be looked at. |
Has there been more data to help with a design for a solution to this problem? Looking at previous comments/PRs, native calls vs |
Closing, assuming that #6974 will be merged soon. Please reopen otherwise. |
@ccastanedaucf has observed (#3547 (comment)) significant time spent in up-to-date checks in https://github.com/Microsoft/msbuild/blob/680224d8ecf9a7da82c001d95db336fd9cfd12d8/src/Build/BackEnd/Components/RequestBuilder/TargetUpToDateChecker.cs#L937
Git for Windows got a big speedup by implementing some caching around checks for individual file timestamps (with the
core.fscache
setting). See https://github.com/git-for-windows/git/blob/master/compat/win32/fscache.c and its history.The gist of the idea is that it's faster to enumerate all files in a directory and get every file's modification timestamp than it is to get the timestamps on an individual basis. Since there's probably a fairly high degree of overlap in the directories of files we're checking for timestamps, I suspect we could get some benefit from this technique too.
The text was updated successfully, but these errors were encountered: