Skip to content

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Aug 3, 2025

This PR scratches a few itches I had when looking at that code.

The perf improvement comes from keeping the scanned set through several marking phases. This pretty much divides by 2 the number of HIR traversals.

@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 Aug 3, 2025
@cjgillot
Copy link
Contributor Author

cjgillot commented Aug 3, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Aug 3, 2025

⌛ Trying commit fdb0651 with merge 2d9299b

To cancel the try build, run the command @bors try cancel.

rust-bors bot added a commit that referenced this pull request Aug 3, 2025
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 3, 2025
@rust-bors
Copy link

rust-bors bot commented Aug 3, 2025

☀️ Try build successful (CI)
Build commit: 2d9299b (2d9299bf7e56a5bbe4eb425be9beb136afa85ac2, parent: f34ba774c78ea32b7c40598b8ad23e75cdac42a6)

@rust-timer

This comment has been minimized.

@cjgillot
Copy link
Contributor Author

cjgillot commented Aug 4, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Aug 4, 2025

⌛ Trying commit effc509 with merge be8ce86

To cancel the try build, run the command @bors try cancel.

rust-bors bot added a commit that referenced this pull request Aug 4, 2025
@rust-bors
Copy link

rust-bors bot commented Aug 4, 2025

☀️ Try build successful (CI)
Build commit: be8ce86 (be8ce86c3741a46b0e888e7a4f5d7b4dbe5da9a2, parent: f34ba774c78ea32b7c40598b8ad23e75cdac42a6)

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (2d9299b): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

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.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@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.3% [0.1%, 0.4%] 16
Improvements ✅
(primary)
-0.4% [-1.2%, -0.1%] 77
Improvements ✅
(secondary)
-0.2% [-0.4%, -0.1%] 9
All ❌✅ (primary) -0.4% [-1.2%, -0.1%] 77

Max RSS (memory usage)

Results (primary 1.6%, secondary 3.9%)

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.6%, 1.6%] 1
Regressions ❌
(secondary)
3.9% [2.5%, 5.2%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.6% [1.6%, 1.6%] 1

Cycles

Results (primary -2.4%, 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)
- - 0
Regressions ❌
(secondary)
4.9% [2.1%, 7.8%] 2
Improvements ✅
(primary)
-2.4% [-2.8%, -2.1%] 4
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.4% [-2.8%, -2.1%] 4

Binary size

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

Bootstrap: 467.629s -> 467.986s (0.08%)
Artifact size: 376.97 MiB -> 376.92 MiB (-0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Aug 4, 2025
@cjgillot
Copy link
Contributor Author

cjgillot commented Aug 4, 2025

While keeping original scanned:
@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Aug 4, 2025
@rust-bors
Copy link

rust-bors bot commented Aug 4, 2025

⌛ Trying commit effc509 with merge af77cf0

To cancel the try build, run the command @bors try cancel.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 4, 2025
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (af77cf0): 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.5% [-1.5%, -0.1%] 79
Improvements ✅
(secondary)
-0.3% [-0.6%, -0.1%] 13
All ❌✅ (primary) -0.5% [-1.5%, -0.1%] 79

Max RSS (memory usage)

Results (primary 1.7%, secondary -4.2%)

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

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

Cycles

Results (primary -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)
- - 0
Improvements ✅
(primary)
-3.1% [-3.1%, -3.1%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -3.1% [-3.1%, -3.1%] 2

Binary size

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

Bootstrap: 468.82s -> 468.751s (-0.01%)
Artifact size: 376.96 MiB -> 376.89 MiB (-0.02%)

@rustbot rustbot removed S-waiting-on-perf Status: Waiting on a perf run to be completed. perf-regression Performance regression. labels Aug 4, 2025
@cjgillot cjgillot marked this pull request as ready for review August 4, 2025 16:52
@rustbot
Copy link
Collaborator

rustbot commented Aug 4, 2025

r? @davidtwco

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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 4, 2025
@Urgau
Copy link
Member

Urgau commented Aug 5, 2025

That's some nice simplification. LGTM.

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 5, 2025

📌 Commit d0da6ca has been approved by Urgau

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 Aug 5, 2025
@Urgau Urgau assigned Urgau and unassigned davidtwco Aug 5, 2025
@samueltardieu
Copy link
Member

Trying to wake bors up
@bors r=Urgau

@bors
Copy link
Collaborator

bors commented Aug 5, 2025

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Collaborator

bors commented Aug 5, 2025

📌 Commit d0da6ca has been approved by Urgau

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Aug 5, 2025

⌛ Testing commit d0da6ca with merge ec7c026...

@bors
Copy link
Collaborator

bors commented Aug 5, 2025

☀️ Test successful - checks-actions
Approved by: Urgau
Pushing ec7c026 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 5, 2025
@bors bors merged commit ec7c026 into rust-lang:master Aug 5, 2025
11 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Aug 5, 2025
Copy link
Contributor

github-actions bot commented Aug 5, 2025

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 213d946 (parent) -> ec7c026 (this PR)

Test differences

Show 45 test diffs

45 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 ec7c02612527d185c379900b613311bc1dcbf7dc --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-apple-2: 3897.8s -> 6291.5s (61.4%)
  2. dist-x86_64-apple: 9214.3s -> 12971.2s (40.8%)
  3. aarch64-apple: 7696.3s -> 4895.5s (-36.4%)
  4. pr-check-2: 2304.0s -> 2793.8s (21.3%)
  5. dist-apple-various: 4727.0s -> 3894.2s (-17.6%)
  6. pr-check-1: 1482.8s -> 1738.0s (17.2%)
  7. x86_64-rust-for-linux: 2663.8s -> 3030.0s (13.7%)
  8. x86_64-gnu-llvm-19: 2537.5s -> 2822.2s (11.2%)
  9. i686-gnu-2: 5400.1s -> 5903.9s (9.3%)
  10. i686-gnu-nopt-1: 7251.1s -> 7898.7s (8.9%)
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
Collaborator

Finished benchmarking commit (ec7c026): 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.0% [0.0%, 0.0%] 1
Improvements ✅
(primary)
-0.5% [-1.5%, -0.1%] 82
Improvements ✅
(secondary)
-0.3% [-0.6%, -0.1%] 12
All ❌✅ (primary) -0.5% [-1.5%, -0.1%] 82

Max RSS (memory usage)

Results (primary 1.6%, secondary -2.4%)

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.1%, 2.0%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.4% [-2.4%, -2.4%] 1
All ❌✅ (primary) 1.6% [1.1%, 2.0%] 2

Cycles

Results (primary -3.1%, secondary -2.3%)

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)
-3.1% [-3.3%, -3.0%] 2
Improvements ✅
(secondary)
-2.3% [-2.4%, -2.2%] 2
All ❌✅ (primary) -3.1% [-3.3%, -3.0%] 2

Binary size

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

Bootstrap: 470.023s -> 467.149s (-0.61%)
Artifact size: 377.52 MiB -> 377.42 MiB (-0.03%)

@cjgillot cjgillot deleted the live-or-dead branch August 5, 2025 23:43
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.

7 participants