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

Folder experiment: Micro-optimize RegionEraserVisitor #139292

Merged
merged 1 commit into from
Apr 5, 2025

Conversation

compiler-errors
Copy link
Member

NOTE: This is one of a series of perf experiments that I've come up with while sick in bed. I'm assigning them to lqd b/c you're a good reviewer and you'll hopefully be awake when these experiments finish, lol.

r? lqd

The region eraser is very hot, so let's see if we can avoid erasing types (and visiting consts and preds that don't have region-ful types) unnecessarily.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 2, 2025
@compiler-errors
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 2, 2025
@bors
Copy link
Collaborator

bors commented Apr 2, 2025

⌛ Trying commit e9dfc29 with merge fd6ccb9...

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 2, 2025
… r=<try>

Folder experiment: Micro-optimize RegionEraserVisitor

**NOTE:** This is one of a series of perf experiments that I've come up with while sick in bed. I'm assigning them to lqd b/c you're a good reviewer and you'll hopefully be awake when these experiments finish, lol.

r? lqd

The region eraser is very hot, so let's see if we can avoid erasing types (and visiting consts and preds that don't have region-ful types) unnecessarily.
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Apr 3, 2025

💔 Test failed - checks-actions

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

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Apr 3, 2025

⌛ Trying commit 9434486 with merge a3e9172...

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 3, 2025
… r=<try>

Folder experiment: Micro-optimize RegionEraserVisitor

**NOTE:** This is one of a series of perf experiments that I've come up with while sick in bed. I'm assigning them to lqd b/c you're a good reviewer and you'll hopefully be awake when these experiments finish, lol.

r? lqd

The region eraser is very hot, so let's see if we can avoid erasing types (and visiting consts and preds that don't have region-ful types) unnecessarily.
@bors
Copy link
Collaborator

bors commented Apr 3, 2025

☀️ Try build successful - checks-actions
Build commit: a3e9172 (a3e9172fc2064003b1878cdafd40dc687a7464ad)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (a3e9172): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking 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.

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

Instruction count

This 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.

mean range count
Regressions ❌
(primary)
0.2% [0.2%, 0.2%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.7% [-34.8%, -0.2%] 16
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.5% [-34.8%, 0.2%] 17

Max RSS (memory usage)

Results (primary 2.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.

mean range count
Regressions ❌
(primary)
2.0% [1.2%, 2.6%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.0% [1.2%, 2.6%] 3

Cycles

Results (primary -8.0%, secondary 3.2%)

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)
3.2% [3.2%, 3.2%] 1
Improvements ✅
(primary)
-8.0% [-15.2%, -0.7%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -8.0% [-15.2%, -0.7%] 2

Binary size

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

Bootstrap: 777.539s -> 774.134s (-0.44%)
Artifact size: 365.91 MiB -> 365.91 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 3, 2025
@compiler-errors compiler-errors marked this pull request as ready for review April 3, 2025 16:17
@compiler-errors
Copy link
Member Author

35% improvement on nalgebra (but just one suite lol) is kinda crazy, surprising it doesn't generalize though

@lqd
Copy link
Member

lqd commented Apr 3, 2025

What the.

So we are currently spending 23% of the time in nalgebra checking for possible inlining cycles 🤯

@lqd
Copy link
Member

lqd commented Apr 4, 2025

badass

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 4, 2025

📌 Commit 9434486 has been approved by lqd

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 4, 2025
@bors
Copy link
Collaborator

bors commented Apr 5, 2025

⌛ Testing commit 9434486 with merge 0c478fd...

@bors
Copy link
Collaborator

bors commented Apr 5, 2025

☀️ Test successful - checks-actions
Approved by: lqd
Pushing 0c478fd to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 5, 2025
@bors bors merged commit 0c478fd into rust-lang:master Apr 5, 2025
7 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 5, 2025
Copy link

github-actions bot commented Apr 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 0e9c3e5 (parent) -> 0c478fd (this PR)

Test differences

No test diffs found

Job duration changes

  1. dist-apple-various: 5890.7s -> 7350.3s (24.8%)
  2. dist-x86_64-apple: 8319.5s -> 9927.8s (19.3%)
  3. x86_64-gnu-stable: 6609.2s -> 7116.7s (7.7%)
  4. dist-armhf-linux: 4989.6s -> 5327.0s (6.8%)
  5. dist-i686-msvc: 6751.6s -> 7115.2s (5.4%)
  6. dist-i686-linux: 5995.8s -> 6266.7s (4.5%)
  7. arm-android: 5249.4s -> 5378.1s (2.5%)
  8. dist-aarch64-apple: 4478.4s -> 4584.5s (2.4%)
  9. x86_64-gnu-llvm-18-3: 6765.7s -> 6909.7s (2.1%)
  10. dist-x86_64-freebsd: 4854.6s -> 4948.2s (1.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 (0c478fd): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This 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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-4.7% [-34.9%, -0.4%] 9
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -4.7% [-34.9%, -0.4%] 9

Max RSS (memory usage)

Results (primary 2.5%, secondary -0.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.

mean range count
Regressions ❌
(primary)
2.5% [2.4%, 2.5%] 2
Regressions ❌
(secondary)
2.6% [2.4%, 2.7%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.3% [-5.2%, -3.5%] 2
All ❌✅ (primary) 2.5% [2.4%, 2.5%] 2

Cycles

Results (primary -8.0%, secondary 4.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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.9% [4.9%, 4.9%] 2
Improvements ✅
(primary)
-8.0% [-15.2%, -0.8%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -8.0% [-15.2%, -0.8%] 2

Binary size

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

Bootstrap: 776.909s -> 775.534s (-0.18%)
Artifact size: 365.93 MiB -> 365.93 MiB (-0.00%)

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.

6 participants