Code Quality: Improved nav perf - #18934
Conversation
|
|
||
| // Speculative directory open started at navigation request time so it overlaps the frame-navigation window. | ||
| private sealed record DirectoryOpenPrefetch(string Path, Task<(Win32PInvoke.SafeFindHandle? Handle, WIN32_FIND_DATA Data, int ErrorCode)> Task); | ||
| private static DirectoryOpenPrefetch? directoryOpenPrefetch; |
There was a problem hiding this comment.
The prefetch might seem like a small gain, but it's better than nothing. I would be happy to skip this change in favor of a better idea.
There was a problem hiding this comment.
I would rather like to remove this prefetch. Implementing a cache also needs proper cache invalidations, which would then complicate the whole thing by a lot.
For example, with this change refreshing a folder can reuse an old scan, which can then lead to missing files. And a drive letter that was previously used by a local drive could later be remapped to a network share while Files is still open. They both lead to correctness regressions.
IMO the risk here is larger than the perf gain.
There was a problem hiding this comment.
Do you have an alternative solution? There is often a short gap between double clicking a folder and the items rendering. It's not a long gap but enough to be noticed.
There was a problem hiding this comment.
I need to profile this path first to identify what is blocking the navigation from happening.
Resolved / Related Issues
To prevent extra work, all changes to the Files codebase must link to an approved issue marked as
Ready to build. Please insert the issue number following the hashtag with the issue number that this Pull Request resolves.Steps used to test these changes
Stability is a top priority for Files and all changes are required to go through testing before being merged into the repo. Please include a list of steps that you used to test this PR.