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

Remove allow(rustc::potential_query_instability) in rustc_trait_selection #103723

Merged
merged 1 commit into from
Nov 9, 2022

Conversation

CastilloDel
Copy link
Contributor

Related to #84447

This PR needs to be benchmarked to check for regressions.

@rustbot
Copy link
Collaborator

rustbot commented Oct 29, 2022

r? @fee1-dead

(rustbot has picked a reviewer for you, use r? to override)

@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 Oct 29, 2022
@fee1-dead
Copy link
Member

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 29, 2022
@bors
Copy link
Contributor

bors commented Oct 29, 2022

⌛ Trying commit c16a32665a417595b1a1fca4121fed423964a27f with merge 752ad3e20a11e4a43bb87b73b85ebb28b2b321c4...

@fee1-dead
Copy link
Member

@rust-timer build 752ad3e20a11e4a43bb87b73b85ebb28b2b321c4

@rust-timer
Copy link
Collaborator

Queued 752ad3e20a11e4a43bb87b73b85ebb28b2b321c4 with parent 33b530e, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (752ad3e20a11e4a43bb87b73b85ebb28b2b321c4): comparison URL.

Overall result: ❌ regressions - 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.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: +S-waiting-on-review -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.7% [0.6%, 0.7%] 2
Regressions ❌
(secondary)
1.0% [0.2%, 1.6%] 9
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.7% [0.6%, 0.7%] 2

Max RSS (memory usage)

Results

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

Cycles

Results

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)
2.5% [2.1%, 3.0%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Oct 29, 2022
@CastilloDel
Copy link
Contributor Author

I guess that's not good enough. Not really sure how it can be improved though

@fee1-dead
Copy link
Member

I am not very good at interpreting perf results so I don't know how to improve this further. Rerolling

r? compiler

@CastilloDel
Copy link
Contributor Author

CastilloDel commented Oct 31, 2022

I think it could be better now

Edit: No, it wasn't. I'm out of ideas. The drain_filter method in indexmap might help, but it will probably take a while if it happens.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Nov 5, 2022

☔ The latest upstream changes (presumably #103991) made this pull request unmergeable. Please resolve the merge conflicts.

@@ -2626,11 +2627,13 @@ impl<'tcx> ProvisionalEvaluationCache<'tcx> {
fn on_completion(&self, dfn: usize) {
debug!(?dfn, "on_completion");

// If IndexMap gets the `drain_filter` method this could be done in one iteration
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we try a perf run with all the other changes except for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! I changed the branch.

@jackh726
Copy link
Member

jackh726 commented Nov 7, 2022

FWIW, I find it easier to just add a commit when doing perf comparisons (so it's easier to see exact changes)

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Nov 7, 2022

⌛ Trying commit 48a76e3fa554064df86f2a2fc039f08d0e2ebc29 with merge df3b01ab5b018aef79cd5650f36b7024e7527092...

@bors
Copy link
Contributor

bors commented Nov 7, 2022

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (df3b01ab5b018aef79cd5650f36b7024e7527092): 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-review -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)
-0.5% [-0.7%, -0.3%] 4
Improvements ✅
(secondary)
-1.0% [-1.6%, -0.3%] 15
All ❌✅ (primary) -0.5% [-0.7%, -0.3%] 4

Max RSS (memory usage)

Results

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.1% [1.1%, 1.1%] 1
Regressions ❌
(secondary)
5.8% [5.8%, 5.8%] 1
Improvements ✅
(primary)
-0.5% [-0.5%, -0.5%] 1
Improvements ✅
(secondary)
-2.6% [-2.6%, -2.6%] 1
All ❌✅ (primary) 0.3% [-0.5%, 1.1%] 2

Cycles

Results

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.6% [0.6%, 0.7%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.4% [-0.4%, -0.4%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [-0.4%, 0.7%] 4

@rustbot rustbot removed S-waiting-on-perf Status: Waiting on a perf run to be completed. perf-regression Performance regression. labels Nov 7, 2022
@jackh726
Copy link
Member

jackh726 commented Nov 8, 2022

Okay, so. Maybe we land this set of changes first. And then land a followup for the bit that regresses perf?

@CastilloDel
Copy link
Contributor Author

FWIW, I find it easier to just add a commit when doing perf comparisons (so it's easier to see exact changes)

Yes, that seems easier. I also realized that I initially had a separate commit for those changes. The next time I will probably wait for the approval before squashing.

Okay, so. Maybe we land this set of changes first. And then land a followup for the bit that regresses perf?

Okay. I guess I need to change the commit description. Do I mark the parts that will change with the followup in some special way or do I leave the FIXMEs as they are now?

@jackh726
Copy link
Member

jackh726 commented Nov 8, 2022

I think I move the allow to the top of the file with a single FIXME explaining perf effect and need to drain_filter on IndexMap

@CastilloDel
Copy link
Contributor Author

Okay, I changed that and rebased the branch!

…c_trait_selection

Make InferCtxtExt use a FxIndexMap

This should be faster, because the map is only being used to iterate,
which is supposed to be faster with the IndexMap

Make the user_computed_preds use an IndexMap

It is being used mostly for iteration, so the change shouldn't result in
a perf hit

Make the RegionDeps fields use an IndexMap

This change could be a perf hit. Both `larger` and `smaller` are used
for iteration, but they are also used for insertions.

Make types_without_default_bounds use an IndexMap

It uses extend, but it also iterates and removes items. Not sure if
this will be a perf hit.

Make InferTtxt.reported_trait_errors use an IndexMap

This change brought a lot of other changes. The map seems to have been
mostly used for iteration, so the performance shouldn't suffer.

Add FIXME to change ProvisionalEvaluationCache.map to use an IndexMap

Right now this results in a perf hit. IndexMap doesn't have
the `drain_filter` API, so in `on_completion` we now need to iterate two
times over the map.
@jackh726
Copy link
Member

jackh726 commented Nov 9, 2022

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Nov 9, 2022

📌 Commit 755ca4b has been approved by jackh726

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 Nov 9, 2022
@bors
Copy link
Contributor

bors commented Nov 9, 2022

⌛ Testing commit 755ca4b with merge cc9b259...

@bors
Copy link
Contributor

bors commented Nov 9, 2022

☀️ Test successful - checks-actions
Approved by: jackh726
Pushing cc9b259 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 9, 2022
@bors bors merged commit cc9b259 into rust-lang:master Nov 9, 2022
@rustbot rustbot added this to the 1.67.0 milestone Nov 9, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (cc9b259): 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)
-0.5% [-0.5%, -0.5%] 1
Improvements ✅
(secondary)
-0.8% [-1.0%, -0.5%] 7
All ❌✅ (primary) -0.5% [-0.5%, -0.5%] 1

Max RSS (memory usage)

Results

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.0% [3.0%, 3.0%] 1
Improvements ✅
(primary)
-2.4% [-2.4%, -2.4%] 1
Improvements ✅
(secondary)
-3.0% [-3.3%, -2.8%] 2
All ❌✅ (primary) -2.4% [-2.4%, -2.4%] 1

Cycles

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

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