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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. 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