Skip to content

Revert "Use drop_guard in some places in {core,alloc,std}" - #162128

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
clarfonthey:revert-drop-guard
Sep 2, 2026
Merged

Revert "Use drop_guard in some places in {core,alloc,std}"#162128
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
clarfonthey:revert-drop-guard

Conversation

@clarfonthey

Copy link
Copy Markdown
Contributor

cc @panstromek @GrigorenkoPV

Reverts this PR due to perf issues, so that a fix can be verified to not affect perf. Apologies for not initially running perf; kinda tunnel-visioned "this just does the same thing" without considering the changes from non-generic functions to generic closures.

@rustbot rustbot added O-unix Operating system: Unix-like 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 Sep 1, 2026
@rustbot

rustbot commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: libs
  • libs expanded to 12 candidates
  • Random selection from JohnTitor, Mark-Simulacrum, joboet

@clarfonthey

Copy link
Copy Markdown
Contributor Author

r? clarfonthey

(Since we don't need to review clean reverts.)

@clarfonthey

Copy link
Copy Markdown
Contributor Author

@bors p=1 rollup=iffy note="Perf regression revert"

@panstromek

Copy link
Copy Markdown
Contributor

Apologies for not initially running perf

No need to apologize, this is totally normal 😉 This is why we run perf on every merge. Perf effects can be pretty non-obvious and unpredictable, I would have trouble predicting this one too.

@clarfonthey

Copy link
Copy Markdown
Contributor Author

I mean, in hindsight, it obviously would have affected perf, but you know :p

@panstromek

Copy link
Copy Markdown
Contributor

@bors p=1 rollup=iffy note="Perf regression revert"

Looks like bors didn't pick it up. Is there r+ missing there?

@clarfonthey

Copy link
Copy Markdown
Contributor Author

I was doing it without r+ because the tests hadn't passed yet, and wanted to wait for PR CI first just in case it wasn't actually a clean merge. And now I can just do this:

@bors r+

@rust-bors

rust-bors Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 7755d45 has been approved by clarfonthey

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Sep 1, 2026
@clarfonthey

Copy link
Copy Markdown
Contributor Author

@bors rollup=iffy note="Reverting regression"

@JonathanBrouwer

JonathanBrouwer commented Sep 1, 2026

Copy link
Copy Markdown
Member

@bors rollup=never
I'd rather not have this in a rolled up, perf effect is too strong which risks masking regressions

@clarfonthey

Copy link
Copy Markdown
Contributor Author

That is extremely fair; I know that we currently unroll for perf so I wasn't sure what the status quo is.

@JonathanBrouwer

JonathanBrouwer commented Sep 1, 2026

Copy link
Copy Markdown
Member

We unroll for perf to create builds that can be benchmarked, but triaging the performance of rollups by running benchmarks is still manual. I'm currently working on automating it

@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 2, 2026
@rust-bors

rust-bors Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: clarfonthey
Duration: 2h 57m 2s
Pushing edc52f8 to main...

@rust-bors
rust-bors Bot merged commit edc52f8 into rust-lang:main Sep 2, 2026
14 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor
What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 5db7f4b (parent) -> edc52f8 (this PR)

Test differences

Show 1528 test diffs

1528 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard edc52f87c28f328c61685a02c47887a5cec7d767 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. x86_64-gnu-debug: 1h 16m -> 2h 12m (+72.5%)
  2. test-various: 1h 38m -> 2h 13m (+36.4%)
  3. x86_64-msvc-1: 2h 8m -> 2h 47m (+30.6%)
  4. x86_64-gnu: 2h 29m -> 1h 44m (-30.1%)
  5. x86_64-rust-for-linux: 54m 39s -> 38m 59s (-28.7%)
  6. dist-x86_64-freebsd: 1h 30m -> 1h 4m (-28.6%)
  7. x86_64-gnu-aux: 1h 58m -> 2h 31m (+27.6%)
  8. dist-x86_64-msvc-alt: 2h 9m -> 2h 45m (+27.4%)
  9. dist-armv7-linux: 1h 16m -> 1h 36m (+25.7%)
  10. dist-x86_64-musl: 2h 24m -> 1h 47m (-25.1%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@clarfonthey
clarfonthey deleted the revert-drop-guard branch September 2, 2026 04:40
@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (edc52f8): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

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

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.7% [0.3%, 1.5%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.5% [-1.9%, -0.2%] 46
Improvements ✅
(secondary)
-0.6% [-1.8%, -0.2%] 26
All ❌✅ (primary) -0.4% [-1.9%, 1.5%] 49

Max RSS (memory usage)

Results (primary -0.9%, secondary -1.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.6% [1.4%, 1.8%] 2
Regressions ❌
(secondary)
2.5% [2.5%, 2.5%] 1
Improvements ✅
(primary)
-1.4% [-2.8%, -0.7%] 10
Improvements ✅
(secondary)
-2.0% [-4.9%, -0.6%] 11
All ❌✅ (primary) -0.9% [-2.8%, 1.8%] 12

Cycles

Results (primary -1.0%, secondary 4.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
4.5% [4.5%, 4.5%] 1
Regressions ❌
(secondary)
4.9% [2.2%, 6.8%] 9
Improvements ✅
(primary)
-2.3% [-2.5%, -2.0%] 4
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.0% [-2.5%, 4.5%] 5

Binary size

Results (primary -1.3%, secondary -1.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.4% [1.4%, 1.4%] 1
Regressions ❌
(secondary)
0.6% [0.6%, 0.6%] 1
Improvements ✅
(primary)
-1.3% [-12.8%, -0.2%] 85
Improvements ✅
(secondary)
-1.7% [-12.8%, -0.5%] 30
All ❌✅ (primary) -1.3% [-12.8%, 1.4%] 86

Bootstrap: 475.082s -> 472.928s (-0.45%)
Artifact size: 400.59 MiB -> 401.53 MiB (0.23%)

@rustbot rustbot added the perf-regression Performance regression. label Sep 2, 2026
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. O-unix Operating system: Unix-like perf-regression Performance regression. 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.

6 participants