perf(linter/plugins): collect tokens even when not needed#19970
perf(linter/plugins): collect tokens even when not needed#19970overlookmotel wants to merge 1 commit intographite-base/19970from
Conversation
|
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.
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Merging this PR will not alter performance
Comparing Footnotes
|
da82af3 to
ffead33
Compare
6284f43 to
c13b437
Compare
|
I don't think this is worthwhile. |

Unconditionally collect tokens in linter, even if they're not needed (files which are not linted with JS plugins).
This is wasteful in terms of memory, but according to CodSpeed is slightly faster (+0.5%) because it removes the
if self.config.tokens()branch fromLexer::finish_next_inner(self.config.tokens()is const-folded totrue). The branch costs more than pushing theTokento theVec<Token>!But this needs measuring in real world to see what actual perf impact is, so can judge the memory/perf trade-off accurately.