perf(parser): speed up simple lookaheads by introducing Lexer::peek_token#11358
Merged
Boshen merged 1 commit intooxc-project:mainfrom Jul 7, 2025
Conversation
CodSpeed Instrumentation Performance ReportMerging #11358 will not alter performanceComparing Summary
|
This comment was marked as outdated.
This comment was marked as outdated.
Member
|
oxc/crates/oxc_parser/src/js/statement.rs Lines 347 to 354 in adbb3a3 FYI: Not often, but in a few places this happens. |
Member
|
This looks very promising! Let's wait until we fix all the code around parser peek before going into this. |
1a8ba85 to
cf5ff60
Compare
Contributor
Author
|
Just rebased to include #11356 that was causing conflicts. |
c9f8278 to
0ec970e
Compare
Lexer::lookahead_tokenLexer::peek_token
Contributor
Author
|
f247fc6 to
65f87d8
Compare
Member
|
I'll take a look at the remaining token peeks before this PR. |
65f87d8 to
7495fb4
Compare
Member
|
Can't resist the 2%! |
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.
This is my proof of concept function to implement @overlookmotel's tip:
source: #11334 (comment)