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

Make NLL Type Relating Eager #108861

Merged
merged 3 commits into from
Mar 23, 2023
Merged

Conversation

b-naber
Copy link
Contributor

@b-naber b-naber commented Mar 7, 2023

We previously instantiated bound regions in nll type relating lazily. Making this eager is more consistent with how we handle type relating in higher_ranked_sub and should allow us to short circuit in case there's structural equality.

@rustbot
Copy link
Collaborator

rustbot commented Mar 7, 2023

r? @petrochenkov

(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 Mar 7, 2023
/// Flag that is set when we enter canonicalization. Used for debugging to ensure
/// that we only collect region information for `BorrowckInferCtxt::reg_var_to_origin`
/// inside non-canonicalization contexts.
pub inside_canonicalization_ctxt: RefCell<bool>,
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 just use a cell for this?

@petrochenkov
Copy link
Contributor

I don't know what is this about.
r? rust-lang/compiler

@rustbot rustbot assigned jackh726 and unassigned petrochenkov Mar 9, 2023
@jackh726
Copy link
Member

jackh726 commented Mar 9, 2023

@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 Mar 9, 2023
@bors
Copy link
Contributor

bors commented Mar 9, 2023

⌛ Trying commit bad5a1251f4369c1de97168d6364b41bc4f51695 with merge 3226a976e09f80fe581c11d2fb5f684eb8059b12...

@bors
Copy link
Contributor

bors commented Mar 9, 2023

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3226a976e09f80fe581c11d2fb5f684eb8059b12): comparison URL.

Overall result: ❌✅ regressions and 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.3% [0.3%, 0.3%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.2%] 1
All ❌✅ (primary) 0.3% [0.3%, 0.3%] 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)
1.8% [0.8%, 2.9%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
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.7% [1.6%, 3.4%] 10
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 9, 2023
@lcnr
Copy link
Contributor

lcnr commented Mar 22, 2023

r=me after rebase

expect there to be some further cleanup possible but I am already pretty happy that we stop lazily relating stuff here

@lcnr
Copy link
Contributor

lcnr commented Mar 22, 2023

r? @lcnr

@rustbot rustbot assigned lcnr and unassigned jackh726 Mar 22, 2023
@lcnr
Copy link
Contributor

lcnr commented Mar 22, 2023

please fixup 57ab3d23846270f6c8fa1d2af229688b6800311e onto the first commit

@rust-cloud-vms rust-cloud-vms bot force-pushed the eager-nll-type-relating branch from bad5a12 to b8a646d Compare March 22, 2023 17:03
@rustbot
Copy link
Collaborator

rustbot commented Mar 22, 2023

These commits modify the Cargo.lock file. Random changes to Cargo.lock can be introduced when switching branches and rebasing PRs.
This was probably unintentional and should be reverted before this PR is merged.

If this was intentional then you can ignore this comment.

@rust-cloud-vms rust-cloud-vms bot force-pushed the eager-nll-type-relating branch 2 times, most recently from 2f5ce51 to 4b6484e Compare March 22, 2023 17:07
@b-naber
Copy link
Contributor Author

b-naber commented Mar 22, 2023

@bors r=lcnr

@bors
Copy link
Contributor

bors commented Mar 22, 2023

📌 Commit 4b6484e88561ee71cb485bb61cd3047a1f3f27c2 has been approved by lcnr

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 Mar 22, 2023
@compiler-errors
Copy link
Member

compiler-errors commented Mar 22, 2023

@b-naber could you squash that "Cargo.lock" commit into whatever commit below it in the stack actually touches the lockfile? It's weird to (presumably accidentally) modify it then revert the modification in separate commits 😅

@compiler-errors
Copy link
Member

compiler-errors commented Mar 22, 2023

Especially because that commit probably should've been titled "revert changes to Cargo.lock" or something more descriptive in any case 😄

But I'd prefer if it didn't exist in the history at all.

@compiler-errors
Copy link
Member

@bors r-

@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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 22, 2023
@rust-cloud-vms rust-cloud-vms bot force-pushed the eager-nll-type-relating branch from 4b6484e to 8f4cf2e Compare March 22, 2023 18:13
@b-naber
Copy link
Contributor Author

b-naber commented Mar 22, 2023

Sorry about that.

@b-naber
Copy link
Contributor Author

b-naber commented Mar 22, 2023

@bors r=lcnr

@bors
Copy link
Contributor

bors commented Mar 22, 2023

📌 Commit 8f4cf2e has been approved by lcnr

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 Mar 22, 2023
@bors
Copy link
Contributor

bors commented Mar 23, 2023

⌛ Testing commit 8f4cf2e with merge 1c771fe...

@bors
Copy link
Contributor

bors commented Mar 23, 2023

☀️ Test successful - checks-actions
Approved by: lcnr
Pushing 1c771fe to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 23, 2023
@bors bors merged commit 1c771fe into rust-lang:master Mar 23, 2023
@rustbot rustbot added this to the 1.70.0 milestone Mar 23, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1c771fe): comparison URL.

Overall result: ❌ regressions - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

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.6% [0.3%, 0.8%] 7
Regressions ❌
(secondary)
0.5% [0.3%, 0.6%] 10
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.8% [-0.8%, -0.8%] 1
All ❌✅ (primary) 0.6% [0.3%, 0.8%] 7

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.8% [0.5%, 1.5%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.3% [-1.4%, -1.2%] 2
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.2% [0.4%, 7.0%] 15
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.9% [-0.9%, -0.9%] 1
All ❌✅ (primary) - - 0

@rustbot rustbot added the perf-regression Performance regression. label Mar 23, 2023
@lcnr
Copy link
Contributor

lcnr commented Mar 23, 2023

this slightly differs from the previous perf run #108861 (comment)

is that noise or did something else change between them?

@b-naber
Copy link
Contributor Author

b-naber commented Mar 23, 2023

I'm not sure whether it's noise or not. The only thing that's changed is that we switched from RefCell to Cell, which seems unlikely to have caused this.

I'm not sure whether tracking the canonicalization context in general is somewhat expensive, but I would suppose just mutating a Cell there should be cheap either way?!

Also kind of weird that the helloworld benchmarks regressed. Do we ever actually get into a binders call there? There also shouldn't be that much canonicalization in compiling that afaict.

@nnethercote
Copy link
Contributor

helloworld has been a bit noisy lately, which is highly annoying :(

@rylev
Copy link
Member

rylev commented Mar 28, 2023

Going to mark this as triaged. A good chunk of the regressions are noise, and the rest are small enough that I don't think it's worth looking too deeply into.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Mar 28, 2023
@lcnr lcnr mentioned this pull request May 3, 2023
Manishearth added a commit to Manishearth/rust that referenced this pull request May 4, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 4, 2023
JohnTitor added a commit to JohnTitor/rust that referenced this pull request May 5, 2023
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. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. 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.

10 participants