ci(benchmarks/lexer): fix lexer benchmark#15517
Conversation
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. |
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the lexer benchmark code by extracting the common lexing logic into a reusable lex_whole_file helper function. The refactoring aims to reduce code duplication and improve maintainability.
Key Changes:
- Extracted common lexer iteration logic into a new
lex_whole_filefunction with#[inline(always)]attribute - Updated both the benchmark loop and
SourceCleaner::cleanmethod to use the new helper function
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CodSpeed Performance ReportMerging #15517 will not alter performanceComparing Summary
Footnotes |
28862fd to
1977909
Compare
1977909 to
c8de3e4
Compare
Merge activity
|
Fix a bug in lexer benchmark. `SourceCleaner` checks that lexer doesn't produce any errors on the cleaned source. But it wasn't using exactly the same code for lexing as the benchmark itself - it wasn't using `Lexer#first_token` to get the first token. Fix that.
c8de3e4 to
4a53d09
Compare

Fix a bug in lexer benchmark.
SourceCleanerchecks that lexer doesn't produce any errors on the cleaned source. But it wasn't using exactly the same code for lexing as the benchmark itself - it wasn't usingLexer#first_tokento get the first token. Fix that.