forked from helix-editor/helix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
File picker: allow parallel traversal w/o sorting
Motivated by the discussion in helix-editor#10995. Sequential traversal is usually very fast, unless it's Windows, or the files are on a (slow) remotely mounted FS. The existing logic of *not* moving injection of file names to a background thread is preserved: if a directory can be traversed in 30ms, all the work happens on the same thread sequentially. To use `WalkParallel`, we need to give up on file name sorting, so add a file picker option for that (defaults to sorting enabled to not change the current behaviour). We _could_ make sorting work for parallel traversal as well, but that requires eagerly traversing the file tree and fully realizing the collection of file paths in memory (so that we can merge partial results from independent workers). It looks like lazy evaluation is preferred and allows us to stop the work early (e.g. if the file picker window is closed). Closes helix-editor#11021.
- Loading branch information
Showing
2 changed files
with
74 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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