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

[perf] skip normalizing param env if it is already normalized #130561

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

lukas-code
Copy link
Member

If the param env is already normalized after elaboration, then we can skip a bunch of expensive operations.

Note

This makes it so that outlives predicates are no longer sorted after non-outlives predicates. Surely this won't make a semantic difference.

r? ghost

@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 Sep 19, 2024
@lukas-code
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 Sep 19, 2024
@bors
Copy link
Contributor

bors commented Sep 19, 2024

⌛ Trying commit 1999d06 with merge 8670a07...

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 19, 2024
[perf] skip normalizing param env if it is already normalized

If the param env is already normalized after elaboration, then we can skip a bunch of expensive operations.

> [!note]
> This makes it so that outlives predicates are no longer sorted after non-outlives predicates. Surely this won't make a semantic difference.

r? ghost
@bors
Copy link
Contributor

bors commented Sep 19, 2024

☀️ Try build successful - checks-actions
Build commit: 8670a07 (8670a07576d5dc11f39d1fa1990bd183ae638b3a)

@rust-timer

This comment has been minimized.

@Dylan-DPC Dylan-DPC added S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 19, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (8670a07): 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 a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.1% [-5.5%, -0.1%] 79
Improvements ✅
(secondary)
-2.7% [-6.5%, -0.2%] 58
All ❌✅ (primary) -1.1% [-5.5%, -0.1%] 79

Max RSS (memory usage)

Results (primary -1.2%, secondary -0.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)
1.1% [0.4%, 2.8%] 5
Improvements ✅
(primary)
-1.2% [-1.2%, -1.2%] 1
Improvements ✅
(secondary)
-2.5% [-3.2%, -2.1%] 3
All ❌✅ (primary) -1.2% [-1.2%, -1.2%] 1

Cycles

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

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)
-2.3% [-4.4%, -0.8%] 17
Improvements ✅
(secondary)
-3.8% [-6.9%, -1.3%] 30
All ❌✅ (primary) -2.3% [-4.4%, -0.8%] 17

Binary size

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

Bootstrap: 769.526s -> 768.035s (-0.19%)
Artifact size: 341.30 MiB -> 341.26 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 19, 2024
@compiler-errors
Copy link
Member

👍

AFAICT, we should not have order dependence for our type outlives obligations at least; I double checked lexical region resolution and MIR borrowck and nothing seemed suspicious there. Or at least, we certainly don't have any order dependence between type-outlives and other predicates.

@bors r+

@bors
Copy link
Contributor

bors commented Sep 19, 2024

📌 Commit 1999d06 has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Sep 19, 2024
@bors
Copy link
Contributor

bors commented Sep 20, 2024

⌛ Testing commit 1999d06 with merge 5793a9e...

@jackh726 jackh726 removed the S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. label Sep 20, 2024
@bors
Copy link
Contributor

bors commented Sep 20, 2024

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing 5793a9e to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 20, 2024
@bors bors merged commit 5793a9e into rust-lang:master Sep 20, 2024
7 checks passed
@rustbot rustbot added this to the 1.83.0 milestone Sep 20, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5793a9e): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.0% [-5.5%, -0.1%] 93
Improvements ✅
(secondary)
-2.7% [-6.5%, -0.2%] 59
All ❌✅ (primary) -1.0% [-5.5%, -0.1%] 93

Max RSS (memory usage)

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

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)
1.7% [1.7%, 1.7%] 1
Regressions ❌
(secondary)
0.4% [0.4%, 0.4%] 3
Improvements ✅
(primary)
-4.9% [-4.9%, -4.9%] 1
Improvements ✅
(secondary)
-2.2% [-2.2%, -2.2%] 2
All ❌✅ (primary) -1.6% [-4.9%, 1.7%] 2

Cycles

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

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)
5.1% [2.5%, 7.7%] 5
Improvements ✅
(primary)
-2.3% [-4.9%, -0.7%] 11
Improvements ✅
(secondary)
-3.6% [-6.2%, -1.4%] 31
All ❌✅ (primary) -2.3% [-4.9%, -0.7%] 11

Binary size

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

Bootstrap: 768.807s -> 768.735s (-0.01%)
Artifact size: 341.34 MiB -> 341.28 MiB (-0.02%)

@lukas-code lukas-code deleted the perf-normalize-env branch September 20, 2024 23:17
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