(poc/RFC) perf(parser): record nodes, scopes, symbols, and references while parsing#4926
Conversation
Your org has enabled the Graphite merge queue for merging into mainAdd the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
d3c3eb1 to
1b3b2ad
Compare
CodSpeed Performance ReportMerging #4926 will degrade performances by 9.54%Comparing Summary
Benchmarks breakdown
|
|
@DonIsaac I've not written up my conclusions on AST Node IDs yet. Will try to do that today. We may be able to use some of the stuff in this PR. |

Add
StatisticstoAstBuilderand record how many AST nodes, symbols, scopes, and references were encountered during parsing.I know @overlookmotel is considering passing around
&mut AstBuilder<'a>in the parser, so I'm putting this here for conversation. It has the following benefits:CopyAnd has the following downsides:
StatisticsCellcan cause a memory leak if not used properlyStatisticsCellimplementation is somewhat esotericNOTE: tests are failing because it does not record quite the correct number of each statistic, yet the point of this PR remains.