Increase performance for Tree sitter matches#2713
Merged
Conversation
Member
|
We're going to test the performance of the test change and the captured to for loop rewrite separately so we can get a better sense for where the improvement is. The loop rewrite is still a nice code cleanliness change on its own, but we'd like to know how much more efficient it is to better calibrate JavaScript performance mentally. |
Member
Author
|
Now I have some data 529k lines json, 11 iterations, median value
|
Member
|
Total performance improvement: 11.45%
|
phillco
approved these changes
Jan 11, 2025
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.
First, were checking the captures against the SCM files in production, which was an oversight - should only be happening in debugging.
Secondarily, the existing implementation multiple map and filters. This part of the code is very time sensitive and can run quite long for large files since we are iterating every capture in the entire file.
This implementation aims to reduce iteration steps
Fixes #2656
Checklist