-
Notifications
You must be signed in to change notification settings - Fork 14k
Make Rc<T>::deref zero-cost
#141348
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?
Make Rc<T>::deref zero-cost
#141348
Conversation
This comment has been minimized.
This comment has been minimized.
df34f84 to
d3a7429
Compare
This comment has been minimized.
This comment has been minimized.
bc84ec6 to
19fb34b
Compare
|
The Miri subtree was changed cc @rust-lang/miri |
19fb34b to
f5245ba
Compare
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Make `Rc<T>::deref` zero-cost This PR makes `Rc::deref` zero-cost by changing the internal pointer so that it points to the value directly instead of the allocation. This is split out from #132553, which will also make `Arc::deref` zero-cost.
|
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (8ef4a25): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary -0.3%, secondary -0.0%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (primary -0.5%, secondary -1.9%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResults (primary 0.2%, secondary 1.6%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 775.728s -> 776.531s (0.10%) |
|
Reminder, once the PR becomes ready for a review, use |
|
☔ The latest upstream changes (presumably #135634) made this pull request unmergeable. Please resolve the merge conflicts. |
31d5740 to
3e4e733
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
6b5dbe1 to
fbb3d03
Compare
This comment has been minimized.
This comment has been minimized.
e7da363 to
b7bca64
Compare
This comment has been minimized.
This comment has been minimized.
b7bca64 to
c8438de
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This PR makes
Rc::derefzero-cost by changing the internal pointer to point directly to the value instead of to the allocation.This PR is split from #132553, which will also make
Arc::derefzero-cost.Review status:
RefCountsandRcLayouttypesRefCountertraitRawWeaktypeRawWeakmethods for sized valuesRawWeakmethods for slice valuesRawWeakRawRctypeRawRcmethods for sized valuesRawRcmethods forMaybeUninit<T>valuesRawRcmethods for slice valuesRawRcmethods fordyn AnytypeRawRcRawUniqueRctypeRawUniqueRcmethods for sized valuesRawUniqueRcalloc::rc::{Rc,Weak,UniqueRc}withalloc::raw_rctypesRcimplementation