-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Printer: Slice based queue and stack #6819
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
PR Check ResultsBenchmarkLinux
Windows
|
2016aae
to
cfe1ec1
Compare
a15564f
to
92ce7de
Compare
cfe1ec1
to
2bf05e3
Compare
2bf05e3
to
1d3b4a1
Compare
The CI benchmarks look like a perf regression |
I need to merge the baseline PR first. I believe our benchmark always compares against main |
1d3b4a1
to
d5d89a0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, given that perf doesn't regress anymore with the new numbers from main
Summary
This PR refactors the
Stack
andQueue
implementations in the Printer to usestd::slice::Iter
instead of aslice
+ offset pointer.This results in a 3% size reduction:
print_element
-> more aggressive inliningruff_formatter ruff_formatter::printer::call_stack::CallStack::top_kind
7 byte reduction (relatively hot)ruff_formatter ruff_formatter::printer::queue::Queue::extend_back
down to a single item and 78 bytesMain
This PR
Test Plan
cargo test