-
Notifications
You must be signed in to change notification settings - Fork 128
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
Improve performance of finding indexables #2082
Open
natematykiewicz
wants to merge
9
commits into
Shopify:main
Choose a base branch
from
natematykiewicz:improve_indexables_performance
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Improve performance of finding indexables #2082
natematykiewicz
wants to merge
9
commits into
Shopify:main
from
natematykiewicz:improve_indexables_performance
Commits on May 23, 2024
-
Improve performance of finding indexables
Currently, all folders and files in the current tree are turned into IndexablePath, and then excluded files are filtered out after. When there are large file trees that are meant to be excluded, this results in a lot of unnecessary work. ActiveStorage stores files in the `tmp` directory in many many small folders. So does Bootsnap. Ruby LSP has to traverse all of these files, even though the entire directory should just be ignored. Rubocop has solved this by breaking the `includes` patterns up into many patterns, applying the exclusions *before* the `Dir.glob`, so I followed in their footsteps. This works great for exclusions that end in "**/*". We still need to loop through all IndexablePath objects and see if they're excluded, in the case that an extension was provided on the excluded path, but this can cut down load time dramatically. Before this PR in my Rails app, `indexables` took 76 seconds to run. Now it takes, 0.17 seconds. Before and after code both return the same exact file list.
Configuration menu - View commit details
-
Copy full SHA for 460e046 - Browse repository at this point
Copy the full SHA 460e046View commit details
Commits on May 30, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 244d64d - Browse repository at this point
Copy the full SHA 244d64dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4c0029a - Browse repository at this point
Copy the full SHA 4c0029aView commit details -
Configuration menu - View commit details
-
Copy full SHA for b6abcc5 - Browse repository at this point
Copy the full SHA b6abcc5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 228b84f - Browse repository at this point
Copy the full SHA 228b84fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 68bb453 - Browse repository at this point
Copy the full SHA 68bb453View commit details
Commits on Jun 8, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 1651c8a - Browse repository at this point
Copy the full SHA 1651c8aView commit details -
Configuration menu - View commit details
-
Copy full SHA for a29ec54 - Browse repository at this point
Copy the full SHA a29ec54View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3a8c7fe - Browse repository at this point
Copy the full SHA 3a8c7feView commit details
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.