-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Move most of TyCtxtAt::$name
into a generic evaluate_query
function
#101178
Conversation
@bors try @rust-timer queue (will be noisy because the other PRs results are mixed in, but the other PR was mostly neutral) |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 945c5aa1c444ce371df6331df39b15e0695132bd with merge 3a9c65e699f299095772bc2c587402acc7dfa3cb... |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #100869) made this pull request unmergeable. Please resolve the merge conflicts. |
91a5a06
to
c1584fa
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit c1584fa72d4b55f73511e40558fc3b209551563e with merge cc5741e85142c1055aaecb2ce088feb90a8b5ab8... |
☀️ Try build successful - checks-actions |
Queued cc5741e85142c1055aaecb2ce088feb90a8b5ab8 with parent 9353538, future comparison URL. |
Finished benchmarking commit (cc5741e85142c1055aaecb2ce088feb90a8b5ab8): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDBenchmarking 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 @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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.
Footnotes |
c1584fa
to
3d9e006
Compare
⌛ Trying commit 3d9e006874c1230a89ea43942f314ce5ba23f8f4 with merge 43ab395f7c492c9ec65610e092ad26cb9879373e... |
It will be a shame to have to add back OnHit but I can do so if it improves perf. |
I can also split d2c53ca to a separate PR to rule out any perf impact, I'll do that this evening. |
☀️ Try build successful - checks-actions |
@rust-timer build 43ab395f7c492c9ec65610e092ad26cb9879373e |
Queued 43ab395f7c492c9ec65610e092ad26cb9879373e with parent e7c7aa7, future comparison URL. |
Finished benchmarking commit (43ab395f7c492c9ec65610e092ad26cb9879373e): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking 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 @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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.
Footnotes |
3d9e006
to
07eadaf
Compare
…ly returning Option I think `copy` may have added some overhead? unclear what's causing the perf impact.
07eadaf
to
3675fdd
Compare
If this doesn't work, I think I may just close the PR; this seems like unnecessarily much work for how little duplication it removes. |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 3675fdd with merge 9c9dde98c61b16603a24ce49807ef1c314a751d2... |
☀️ Try build successful - checks-actions |
Queued 9c9dde98c61b16603a24ce49807ef1c314a751d2 with parent 1d37ed6, future comparison URL. |
Finished benchmarking commit (9c9dde98c61b16603a24ce49807ef1c314a751d2): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDBenchmarking 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 @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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.
Footnotes |
…llot Move `Queries::new` out of the macro Split out from rust-lang#101178 to make sure it's not contributing to the perf impact. r? `@cjgillot`
#[inline(always)] | ||
fn copy<T: Copy>(x: &T) -> T { | ||
*x | ||
fn evaluate_query<'tcx, Cache>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try this with #[inline(always)]
? The callers all have that so this should regress without it.
Helps with #96524. This is based on #100943, so it looks larger than it is.
Queries::new
out of thedefine_callbacks
macro. This is a very small cleanup, happy to move it to its own PR.TyCtxtAt::$name
into a generic function. There were a couple different approaches I could have taken here, see https://rust-lang.zulipchat.com/#narrow/stream/241847-t-compiler.2Fwg-incr-comp/topic/making.20.60TyCtxtAt.3A.3A.24query.60.20generic.20.2396524. I chose to use aQueryCache
generic type argument and pass intcx.query_caches.$name
instead of doing a much larger refactor to definequeries::$name
in rustc_middle instead of rustc_query_impl.OnHit
generic parameter totry_get_cached
. It was always used withcopy
after my refactor.r? @cjgillot