-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Optimize RcInnerPtr::inc_strong()/inc_weak() instruction count #95224
Conversation
Inspired by this internals thread: https://internals.rust-lang.org/t/rc-optimization-on-64-bit-targets/16362 [The generated assembly is a bit smaller](https://rust.godbolt.org/z/TeTnf6144) and is a more efficient usage of the CPU's instruction cache. `unlikely` doesn't impact any of the small artificial tests I've done, but I've included it in case it might help more complex scenarios when this is inlined.
r? @yaahc (rust-highfive has picked a reviewer for you, use r? to override) |
Looks great, thank you for the PR! @bors r+ |
📌 Commit 8d14c03 has been approved by |
Optimize RcInnerPtr::inc_strong()/inc_weak() instruction count Inspired by this internals thread: https://internals.rust-lang.org/t/rc-optimization-on-64-bit-targets/16362 [The generated assembly is a bit smaller](https://rust.godbolt.org/z/TeTnf6144) and is a more efficient usage of the CPU's instruction cache. `unlikely` doesn't impact any of the small artificial tests I've done, but I've included it in case it might help more complex scenarios when this is inlined.
@bors rollup=never |
⌛ Testing commit 8d14c03 with merge 78bca4dd0d02b7d3ec42f55ff0511b4a7894811d... |
@bors retry (letting rollup go first since queue is long) |
⌛ Testing commit 8d14c03 with merge 2761af47284e3ef7ac9a027a40e98da242fb60ac... |
@bors retry -- gha-self-hosted restart |
☀️ Test successful - checks-actions |
Finished benchmarking commit (bb1a03c): comparison url. Summary:
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Footnotes |
@rustbot label: +perf-regression-triaged |
Inspired by this internals thread: https://internals.rust-lang.org/t/rc-optimization-on-64-bit-targets/16362
The generated assembly is a bit smaller and is a more efficient usage of the CPU's instruction cache.
unlikely
doesn't impact any of the small artificial tests I've done, but I've included it in case it might help more complex scenarios when this is inlined.