Skip to content

Perf regression fix#150056

Merged
bors merged 1 commit into
rust-lang:mainfrom
Kivooeo:trying-to-address-perf
Dec 19, 2025
Merged

Perf regression fix#150056
bors merged 1 commit into
rust-lang:mainfrom
Kivooeo:trying-to-address-perf

Conversation

@Kivooeo

@Kivooeo Kivooeo commented Dec 16, 2025

Copy link
Copy Markdown
Member

The only thing changed from the previous PR is that I removed output_is_inhabited from hot path, and hide it behind condition, so now it will compute it less frequent

follow up on #149664

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 16, 2025
@Kivooeo

Kivooeo commented Dec 16, 2025

Copy link
Copy Markdown
Member Author

@rust-timer build 9124eca

@Kivooeo

Kivooeo commented Dec 16, 2025

Copy link
Copy Markdown
Member Author

@Kobzol how do i run this

@Kobzol

Kobzol commented Dec 16, 2025

Copy link
Copy Markdown
Member

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors Bot added a commit that referenced this pull request Dec 16, 2025
@rust-bors

rust-bors Bot commented Dec 16, 2025

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 48c5d38 (48c5d3879672c42316e3b17a082885381ab2cfb9, parent: 95a27adcf907bcc1046602c3746dad8cfdf3bf3f)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (48c5d38): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.2% [-0.3%, -0.2%] 19
Improvements ✅
(secondary)
-0.3% [-0.4%, -0.2%] 12
All ❌✅ (primary) -0.2% [-0.3%, -0.2%] 19

Max RSS (memory usage)

Results (primary 2.1%, secondary 2.2%)

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

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

Cycles

Results (secondary -2.7%)

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

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.7% [-2.9%, -2.5%] 2
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 479.485s -> 478.535s (-0.20%)
Artifact size: 390.32 MiB -> 390.28 MiB (-0.01%)

@Kivooeo

Kivooeo commented Dec 16, 2025

Copy link
Copy Markdown
Member Author

hm, wait how do I even understand if perf is fine? is there a way to check perf between two commits? I believe there's been a numerous amount of changes in this period of time that affects a bootstrap time

but on the other hand it's not a 5 second reduce, not sure how to interpret this results

@Kobzol

Kobzol commented Dec 16, 2025

Copy link
Copy Markdown
Member

Bootstrap time is not super important here, I would say. Based on the icount results, it looks like this change does indeed fix the regression!

@Kivooeo Kivooeo marked this pull request as ready for review December 16, 2025 20:17
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 16, 2025
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Dec 16, 2025
@rustbot

rustbot commented Dec 16, 2025

Copy link
Copy Markdown
Collaborator

r? @SparrowLii

rustbot has assigned @SparrowLii.
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

@Kivooeo

Kivooeo commented Dec 16, 2025

Copy link
Copy Markdown
Member Author

r? @davidtwco

@rustbot rustbot assigned davidtwco and unassigned SparrowLii Dec 16, 2025
@Kivooeo Kivooeo changed the title trying to address perf regression Perf regression fix Dec 16, 2025
@Kivooeo

Kivooeo commented Dec 16, 2025

Copy link
Copy Markdown
Member Author

Based on the icount results, it looks like this change does indeed fix the regression!

Ah, thanks for the clarification!

@rust-cloud-vms rust-cloud-vms Bot force-pushed the trying-to-address-perf branch from 9124eca to fc0d01b Compare December 16, 2025 21:34
@Kivooeo

Kivooeo commented Dec 16, 2025

Copy link
Copy Markdown
Member Author

I want to try different approach, should be even better, do I need to rerun bors try before next perf run?

@Kobzol

Kobzol commented Dec 16, 2025

Copy link
Copy Markdown
Member

Yes, rustc-perf always benchmarks the result of the try build :)

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors Bot added a commit that referenced this pull request Dec 16, 2025
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 16, 2025
@rust-bors

rust-bors Bot commented Dec 16, 2025

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: da3c48f (da3c48f3bacfa34354f911642899ba5eb24ea620, parent: 31010ca61c3ff019e1480dda0a7ef16bd2bd51c0)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (da3c48f): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.2% [-0.3%, -0.2%] 18
Improvements ✅
(secondary)
-0.3% [-0.4%, -0.2%] 10
All ❌✅ (primary) -0.2% [-0.3%, -0.2%] 18

Max RSS (memory usage)

Results (primary 2.0%, secondary -0.3%)

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

mean range count
Regressions ❌
(primary)
2.0% [2.0%, 2.0%] 1
Regressions ❌
(secondary)
4.3% [4.3%, 4.3%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.6% [-3.0%, -2.3%] 2
All ❌✅ (primary) 2.0% [2.0%, 2.0%] 1

Cycles

Results (secondary 3.1%)

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

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

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 479.038s -> 478.549s (-0.10%)
Artifact size: 390.32 MiB -> 390.27 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 17, 2025
@Kivooeo

Kivooeo commented Dec 17, 2025

Copy link
Copy Markdown
Member Author

looks slightly better right?

@Kobzol

Kobzol commented Dec 17, 2025

Copy link
Copy Markdown
Member

Looks pretty much the same to me.

@Kivooeo

Kivooeo commented Dec 18, 2025

Copy link
Copy Markdown
Member Author

Nominate this to beta backport as was discussed on todays triage meeting because it's a follow up on a beta accepted PR

@rustbot label +beta-nominated

@rustbot rustbot added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Dec 18, 2025
@davidtwco

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Dec 19, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit fc0d01b has been approved by davidtwco

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 Dec 19, 2025
@bors

bors commented Dec 19, 2025

Copy link
Copy Markdown
Collaborator

⌛ Testing commit fc0d01b with merge 806c2a3...

@bors

bors commented Dec 19, 2025

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-actions
Approved by: davidtwco
Pushing 806c2a3 to main...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 19, 2025
@bors bors merged commit 806c2a3 into rust-lang:main Dec 19, 2025
13 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Dec 19, 2025
@github-actions

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 b889870 (parent) -> 806c2a3 (this PR)

Test differences

Show 2 test diffs

2 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 806c2a35dcc1db7867864fea0a7a65554a5238b7 --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. aarch64-apple: 11536.2s -> 9361.6s (-18.9%)
  2. pr-check-1: 1913.0s -> 1559.0s (-18.5%)
  3. x86_64-gnu-miri: 4858.9s -> 4149.4s (-14.6%)
  4. x86_64-gnu-tools: 3753.8s -> 3258.4s (-13.2%)
  5. test-various: 7619.6s -> 6635.9s (-12.9%)
  6. x86_64-gnu-llvm-21-3: 7077.5s -> 6224.2s (-12.1%)
  7. i686-gnu-2: 6017.0s -> 5310.1s (-11.7%)
  8. i686-gnu-1: 8459.0s -> 7480.3s (-11.6%)
  9. dist-powerpc64-linux: 5940.8s -> 5281.5s (-11.1%)
  10. dist-x86_64-apple: 7408.8s -> 8153.6s (+10.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.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (806c2a3): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.2% [-0.3%, -0.2%] 18
Improvements ✅
(secondary)
-0.3% [-0.4%, -0.1%] 12
All ❌✅ (primary) -0.2% [-0.3%, -0.2%] 18

Max RSS (memory usage)

Results (primary -3.5%, 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)
- - 0
Regressions ❌
(secondary)
1.6% [0.9%, 2.2%] 2
Improvements ✅
(primary)
-3.5% [-6.5%, -1.5%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -3.5% [-6.5%, -1.5%] 3

Cycles

Results (primary 6.7%, secondary 4.7%)

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

mean range count
Regressions ❌
(primary)
6.7% [2.2%, 18.8%] 7
Regressions ❌
(secondary)
4.7% [2.1%, 9.7%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 6.7% [2.2%, 18.8%] 7

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 479.396s -> 477.964s (-0.30%)
Artifact size: 390.52 MiB -> 390.53 MiB (0.00%)

@apiraino

apiraino commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

Beta backport declined as per compiler team on Zulip. The advantages are thin and don't make the backport a compelling choice.

@rustbot label -beta-nominated

@rustbot rustbot removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jan 8, 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. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants