[turbopack] Use ast_path.kinds() instead of mapping over ast_path in the analyzer#94221
Merged
sampoder merged 1 commit intoMay 30, 2026
Conversation
Contributor
Tests PassedCommit: 6896fc7 |
Contributor
Stats skippedCommit: 6896fc7 |
mischnic
approved these changes
May 29, 2026
bgw
approved these changes
May 29, 2026
91a6ffa to
f1fdb47
Compare
feb80ef to
98c9490
Compare
f1fdb47 to
8c145b1
Compare
98c9490 to
38c18ab
Compare
e8c3f45 to
bac9ce7
Compare
5693ec6 to
70bac01
Compare
1a42441 to
3f17609
Compare
70bac01 to
254fe0d
Compare
3f17609 to
0019d3a
Compare
254fe0d to
3012de3
Compare
… in the analyzer
3012de3 to
6896fc7
Compare
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.
@lukesandberg and I were looking at the call stack for the analyzer this morning and we talked about how we appeared to be spending a lot of time calculating the kind of each node's parent, see:
Interestingly, SWC also appears to be calculating this information based on the call stack. And it appears that SWC's
AstNodePath'skinds()method is a pre-computed version of what we were computing. This PR switches us to using that method to see if there any potential performance benefits.I think I need a little bit of help benchmarking this more but running:
First on the branch without this switch, and then on this branch suggests improvements: