-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Improve lexer performance by 5-10% overall, improve string lexer performance 15% #149689
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?
Conversation
|
r? @nnethercote rustbot has assigned @nnethercote. Use |
This comment has been minimized.
This comment has been minimized.
|
this is the benchmark library to track performance changes: |
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Improve lexer performance by 5-10% overall, improve string lexer performance 15%
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (e0cf684): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary 2.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 3.1%, secondary 1.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 470.249s -> 469.703s (-0.12%) |
Hi, this PR improves lexer performance by ~5-10% when lexing the entire standard library. It specifically targets the string lexer, comment lexer, and frontmatter lexer.
eat_past2function that leveragesmemchr2.format!and rewrote the lexer usingmemchr-based scanning, which is roughly 4× faster.I also applied a few minor optimizations in other areas.
I’ll send the benchmark repo in the next message. Here are the results on my x86_64 laptop (AMD 6650U):