-
-
Notifications
You must be signed in to change notification settings - Fork 595
perf(parser): speed up simple lookaheads by introducing Lexer::peek_token
#11358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
perf(parser): speed up simple lookaheads by introducing Lexer::peek_token
#11358
Conversation
CodSpeed Instrumentation Performance ReportMerging #11358 will improve performances by 18.72%Comparing Summary
Benchmarks breakdown
|
This comment was marked as outdated.
This comment was marked as outdated.
oxc/crates/oxc_parser/src/js/statement.rs Lines 347 to 354 in adbb3a3
FYI: Not often, but in a few places this happens. |
This looks very promising! Let's wait until we fix all the code around parser peek before going into this. |
1a8ba85
to
cf5ff60
Compare
Just rebased to include #11356 that was causing conflicts. |
c9f8278
to
0ec970e
Compare
Lexer::lookahead_token
Lexer::peek_token
|
f247fc6
to
65f87d8
Compare
I'll take a look at the remaining token peeks before this PR. |
This is my proof of concept function to implement @overlookmotel's tip:
source: #11334 (comment)