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

Group some fields in a common struct so we only pass one reference instead of three #105357

Merged
merged 4 commits into from
Dec 10, 2022

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Dec 6, 2022

@rustbot
Copy link
Collaborator

rustbot commented Dec 6, 2022

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @cjgillot (or someone else) soon.

Please see the contribution instructions for more information.

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Dec 6, 2022
@rustbot
Copy link
Collaborator

rustbot commented Dec 6, 2022

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@oli-obk oli-obk changed the title Feeding Replace more untracked TyCtxt fields with fed queries Dec 6, 2022
@oli-obk oli-obk force-pushed the feeding branch 2 times, most recently from 6a2a9c5 to 09baefd Compare December 6, 2022 08:39
@oli-obk
Copy link
Contributor Author

oli-obk commented Dec 6, 2022

@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 Dec 6, 2022
@bors
Copy link
Contributor

bors commented Dec 6, 2022

⌛ Trying commit 09baefdd8065d8e799b114874b13957c405a7cf0 with merge f5930b26e08ab39ce89ce55df2ef20a00698b0d3...

@rust-log-analyzer

This comment has been minimized.

@oli-obk
Copy link
Contributor Author

oli-obk commented Dec 6, 2022

I... can't reproduce this failure locally. It happens neither with x.py check nor with x.py build

@oli-obk
Copy link
Contributor Author

oli-obk commented Dec 6, 2022

Aha! only happens with parallel-compiler=true

@rust-log-analyzer

This comment has been minimized.

@oli-obk
Copy link
Contributor Author

oli-obk commented Dec 6, 2022

@rust-timer build f5930b26e08ab39ce89ce55df2ef20a00698b0d3

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f5930b26e08ab39ce89ce55df2ef20a00698b0d3): 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-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)
1.2% [0.2%, 3.0%] 131
Regressions ❌
(secondary)
1.5% [0.1%, 4.9%] 112
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.2% [0.2%, 3.0%] 131

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.1% [0.6%, 1.5%] 3
Improvements ✅
(primary)
-2.2% [-2.2%, -2.2%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.2% [-2.2%, -2.2%] 1

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)
1.6% [0.7%, 3.1%] 22
Regressions ❌
(secondary)
2.7% [0.9%, 5.0%] 29
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.6% [0.7%, 3.1%] 22

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

oli-obk commented Dec 6, 2022

I fear this regression is solely because going through a query is always more expensive than just accessing a field. I'm still going to bisect this to find the exact commit that caused the regression, but I think in the end we'll have to land it just to get rid of untracked state.

@oli-obk
Copy link
Contributor Author

oli-obk commented Dec 6, 2022

@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 Dec 6, 2022
@oli-obk
Copy link
Contributor Author

oli-obk commented Dec 9, 2022

r? @petrochenkov

@rustbot ready

@rustbot
Copy link
Collaborator

rustbot commented Dec 9, 2022

Could not assign reviewer from: petrochenkov.
User(s) petrochenkov are either the PR author or are already assigned, and there are no other candidates.
Use r? to specify someone else to assign.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 9, 2022
@petrochenkov
Copy link
Contributor

@bors r=cjgillot,petrochenkov

@bors
Copy link
Contributor

bors commented Dec 10, 2022

📌 Commit 75ff5c7 has been approved by cjgillot,petrochenkov

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 Dec 10, 2022
@bors
Copy link
Contributor

bors commented Dec 10, 2022

⌛ Testing commit 75ff5c7 with merge cbc70ff...

@bors
Copy link
Contributor

bors commented Dec 10, 2022

☀️ Test successful - checks-actions
Approved by: cjgillot,petrochenkov
Pushing cbc70ff to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 10, 2022
@bors bors merged commit cbc70ff into rust-lang:master Dec 10, 2022
@rustbot rustbot added this to the 1.68.0 milestone Dec 10, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (cbc70ff): comparison URL.

Overall result: ❌✅ regressions and improvements - 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.4% [0.2%, 0.7%] 23
Regressions ❌
(secondary)
0.4% [0.1%, 0.7%] 22
Improvements ✅
(primary)
-0.5% [-0.8%, -0.2%] 33
Improvements ✅
(secondary)
-0.9% [-1.4%, -0.2%] 18
All ❌✅ (primary) -0.1% [-0.8%, 0.7%] 56

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

@oli-obk oli-obk deleted the feeding branch December 10, 2022 14:20
@nnethercote
Copy link
Contributor

Wins appear to roughly equal or slightly outweigh the losses here.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Dec 11, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 21, 2023
…rochenkov

give the resolver access to TyCtxt

The resolver is now created after TyCtxt is created. Then macro expansion and name resolution are run and the results fed into queries just like before this PR.

Since the resolver had (before this PR) mutable access to the `CStore` and the source span table, these two datastructures are now behind a `RwLock`. To ensure that these are not mutated anymore after the resolver is done, a read lock to them is leaked right after the resolver finishes.

### PRs split out of this one and leading up to it:

* rust-lang#105423
* rust-lang#105357
* rust-lang#105603
* rust-lang#106776
* rust-lang#106810
* rust-lang#106812
* rust-lang#108032
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request Apr 20, 2024
give the resolver access to TyCtxt

The resolver is now created after TyCtxt is created. Then macro expansion and name resolution are run and the results fed into queries just like before this PR.

Since the resolver had (before this PR) mutable access to the `CStore` and the source span table, these two datastructures are now behind a `RwLock`. To ensure that these are not mutated anymore after the resolver is done, a read lock to them is leaked right after the resolver finishes.

### PRs split out of this one and leading up to it:

* rust-lang/rust#105423
* rust-lang/rust#105357
* rust-lang/rust#105603
* rust-lang/rust#106776
* rust-lang/rust#106810
* rust-lang/rust#106812
* rust-lang/rust#108032
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request Apr 27, 2024
give the resolver access to TyCtxt

The resolver is now created after TyCtxt is created. Then macro expansion and name resolution are run and the results fed into queries just like before this PR.

Since the resolver had (before this PR) mutable access to the `CStore` and the source span table, these two datastructures are now behind a `RwLock`. To ensure that these are not mutated anymore after the resolver is done, a read lock to them is leaked right after the resolver finishes.

### PRs split out of this one and leading up to it:

* rust-lang/rust#105423
* rust-lang/rust#105357
* rust-lang/rust#105603
* rust-lang/rust#106776
* rust-lang/rust#106810
* rust-lang/rust#106812
* rust-lang/rust#108032
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants