fix: optimize file lookup for large folders - #3366
Open
arryndoestech wants to merge 1 commit into
Open
Conversation
Replaced the previous O(N^2) file lookup with one that: 1. Builds the map of the files with the path 2. Iterates over the sorted nodes and retrieves each file from the map This turns the O(N^2) lookup into 2 O(N) operations Tested on a folder with about 10 000 files this cuts down the time to finish enumerating fromabout 90 seconds to about 11 seconds Also fixes the browser becoming unresponsive for that time Signed-off-by: arryndoestech <178195651+arryndoestech@users.noreply.github.com>
skjnldsv
approved these changes
Sep 8, 2026
Member
|
/backport to stable35 |
Member
|
/backport to stable34 |
Member
|
/backport to stable33 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Replaced the previous O(N^2) file lookup with one that:
This turns the O(N^2) lookup into 2 O(N) operations Tested on a folder with about 10 000 files
this cuts down the time to finish enumerating fromabout 90 seconds to about 11 seconds
Also fixes the browser becoming unresponsive for that time
fixes: #3217 and #3015
I didn't see those before and didn't see that something was already in the works
You can choose to not merge it and wait for the changes mentioned in those issues
馃 AI (if applicable)