Skip to content
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

Revert Vec/Rc storage reuse opt #104571

Merged
merged 1 commit into from
Nov 19, 2022
Merged

Conversation

clubby789
Copy link
Contributor

@clubby789 clubby789 commented Nov 18, 2022

Remove the optimization for using storage added by #104205.
The perf wins were pretty small, and it relies on non-guarenteed behaviour. On platforms that don't implement shrinking in place, the performance will be significantly worse.

While it could be gated to platforms that do this (such as GNU), I don't think it's worth the overhead of maintaining it for very small gains. (#104565, #104563)

cc @RalfJung @matthiaskrgr

Fixes #104565
Fixes #104563

@rustbot
Copy link
Collaborator

rustbot commented Nov 18, 2022

r? @m-ou-se

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 18, 2022
@rustbot
Copy link
Collaborator

rustbot commented Nov 18, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@the8472
Copy link
Member

the8472 commented Nov 18, 2022

This doesn't seem to be a revert of #104205, any reason you didn't use git revert? Are there pieces that should be kept?

@clubby789
Copy link
Contributor Author

clubby789 commented Nov 18, 2022

The changes I kept were moving the RcBox/ArcInner layout calculation to its own function, instead of having it (and the explanatory comment) duplicated 2 or 3 times over the file - as well as some formatting fixes to the doc comments

@the8472
Copy link
Member

the8472 commented Nov 19, 2022

Ok, looks good. Bumping prio since this should fix sporadic CI failures.

@bors r+ p=1

@bors
Copy link
Contributor

bors commented Nov 19, 2022

📌 Commit 27019f1 has been approved by the8472

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 19, 2022
@the8472 the8472 changed the title Remove Vec/Rc storage reuse opt Revert Vec/Rc storage reuse opt Nov 19, 2022
@bors
Copy link
Contributor

bors commented Nov 19, 2022

⌛ Testing commit 27019f1 with merge 62c627c...

@bors
Copy link
Contributor

bors commented Nov 19, 2022

☀️ Test successful - checks-actions
Approved by: the8472
Pushing 62c627c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 19, 2022
@bors bors merged commit 62c627c into rust-lang:master Nov 19, 2022
@rustbot rustbot added this to the 1.67.0 milestone Nov 19, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (62c627c): comparison URL.

Overall result: ❌ regressions - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.5% [0.4%, 0.5%] 5
Regressions ❌
(secondary)
1.2% [1.2%, 1.2%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.5% [0.4%, 0.5%] 5

Max RSS (memory usage)

Results

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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.9% [1.0%, 2.8%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.0% [-3.2%, -0.9%] 2
All ❌✅ (primary) - - 0

Cycles

Results

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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.1% [-2.1%, -2.1%] 1
All ❌✅ (primary) - - 0

@rustbot rustbot added the perf-regression Performance regression. label Nov 19, 2022
@the8472
Copy link
Member

the8472 commented Nov 19, 2022

This removes a recently-merged optimization that caused CI failures because it doesn't work reliably on all platforms.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Nov 19, 2022
Aaron1011 pushed a commit to Aaron1011/rust that referenced this pull request Jan 6, 2023
Revert Vec/Rc storage reuse opt

Remove the optimization for using storage added by rust-lang#104205.
The perf wins were pretty small, and it relies on non-guarenteed behaviour. On platforms that don't implement shrinking in place, the performance will be significantly worse.

While it could be gated to platforms that do this (such as GNU), I don't think it's worth the overhead of maintaining it for very small gains. (rust-lang#104565, rust-lang#104563)

cc `@RalfJung` `@matthiaskrgr`

Fixes rust-lang#104565
Fixes rust-lang#104563
@clubby789 clubby789 deleted the remove-vec-rc-opt branch February 11, 2023 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UB in arc_from_vec_opt test spurious test failure: rc::rc_from_vec_opt on window
6 participants