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 |
120b6ad to
fd93f9f
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
fd93f9f to
307f110
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
307f110 to
c3ba010
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. |
|
☔ The latest upstream changes (presumably #162148) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
|
@tgross35 what is the status of reviewing this? Mostly because I think that we want this and it's blocking work for custom allocators on these types, and I keep seeing it rebased without any review progress. Would be willing to help take over review after RustConf if you don't have the bandwidth. |
This comment was marked as outdated.
This comment was marked as outdated.
|
? I don't think I clicked comment, sorry that reply wasn't complete Yeah this is something that I haven't been able to completely review, and the others I've talked to also haven't been able to pick it up—just massive surface area rewriting some critical API. More recently we talked about doing a group review to make it more feasible, I'll loop you in for that |
View all comments
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