Faster browsing in Explorer (obtain file metadata from parent directories) #214
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.
The goal of this change is to use directory entries instead of querying individual file modification times
GetFileModifyTime
, which would again make viewing directories faster in Explorer.However, there are caveats:
Reparse point & symbolic link handling might need a review. I may have missed something. Or if there are any other edge cases where parent directory entries and direct queries give different results, those would probably need addressing as well.
This may use considerably more memory for repositories with large work trees, so it might make sense to make this an option that the user can turn on rather than enabling it by default. Ideally this wouldn't be necessary—higher-level changes would allow us to enumerate directories in batch and only keep the entries that we need—but addressing that might require some less trivial surgery in the code.
I'm not entirely sure when exactly the cache should be invalidated, or if there are any race conditions or threading issues that I'm unaware of, but I tried to be "safe" about these by clearing the at some point just to make sure entries don't get too stale.