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 query keys Copy #108169

Merged
merged 1 commit into from
Feb 24, 2023
Merged

Make query keys Copy #108169

merged 1 commit into from
Feb 24, 2023

Conversation

Zoxc
Copy link
Contributor

@Zoxc Zoxc commented Feb 17, 2023

This regressed compiler performance locally, so I'm curious what perf will say about it.

BenchmarkBeforeAfter
TimeTime%
🟣 clap:check1.7566s1.7657s 0.52%
🟣 hyper:check0.2572s0.2578s 0.20%
🟣 regex:check0.9863s0.9900s 0.37%
🟣 syn:check1.6018s1.6073s 0.34%
🟣 syntex_syntax:check6.2493s6.2920s 0.68%
Total10.8512s10.9127s 0.57%
Summary1.0000s1.0042s 0.42%

@rustbot
Copy link
Collaborator

rustbot commented Feb 17, 2023

r? @compiler-errors

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

@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. labels Feb 17, 2023
@compiler-errors
Copy link
Member

@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 Feb 17, 2023
@bors
Copy link
Collaborator

bors commented Feb 17, 2023

⌛ Trying commit f08eb62ee7cc44d8b1d58e1e1eec5cd3d5a523b8 with merge 9c22b17bd3e6c2fe3a1b6bcb05ba469bf3296191...

@Zoxc
Copy link
Contributor Author

Zoxc commented Feb 17, 2023

Adding some inline attributes helped:

BenchmarkBeforeAfter
TimeTime%
🟣 clap:check1.7619s1.7616s -0.01%
🟣 hyper:check0.2563s0.2565s 0.11%
🟣 regex:check0.9847s0.9831s -0.16%
🟣 syn:check1.5878s1.5858s -0.12%
🟣 syntex_syntax:check6.1293s6.1229s -0.10%
Total10.7199s10.7099s -0.09%
Summary1.0000s0.9994s -0.06%

r? @cjgillot

@rustbot rustbot assigned cjgillot and unassigned compiler-errors Feb 17, 2023
@Zoxc Zoxc changed the title [WIP] Make query keys Copy Make query keys Copy Feb 17, 2023
@compiler-errors
Copy link
Member

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Feb 17, 2023

⌛ Trying commit ae9d819177371b1f6038e8f6ae753cd9cc1eb129 with merge 5440299fe26307a7a84dabc1d378b0d64d05931f...

@cjgillot
Copy link
Contributor

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Feb 17, 2023

⌛ Trying commit 9bfa18c3a00886103f5ca0b4775fd9eb62317dc4 with merge 0218c3d1a786c9070e87cedc809ddad3b1da2f58...

@bors
Copy link
Collaborator

bors commented Feb 18, 2023

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0218c3d1a786c9070e87cedc809ddad3b1da2f58): comparison URL.

Overall result: ❌ regressions - 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)
2.6% [2.6%, 2.6%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

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

Cycles

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

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

Perf does not show any effect, but this changes helps to ensure that we won't have surprises in the future.
Could you:

  • remove the extra inline annotations;
  • add a comment to explain that the Copy requirement, while not necessary, allows to avoid surprises with potentially expensive cloning.

@bors rollup-
r=me afterwards

@Zoxc
Copy link
Contributor Author

Zoxc commented Feb 19, 2023

I would like to see rustc_query_impl bootstrap times as I suspect the functions I put inline(always) were getting inlined previously. Do you know why perf didn't show them? I think a tool that can show changes in inlining behavior would be useful.

@cjgillot
Copy link
Contributor

There appears to be an issue with the perf infra, see the error message on https://perf.rust-lang.org/status.html
I did not attempt to investigate.

@Zoxc
Copy link
Contributor Author

Zoxc commented Feb 21, 2023

I added the comment and also verified that the inlining behavior in rustc_query_impl is unchanged. My initial benchmark was noisy for some reason.

@cjgillot
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Feb 22, 2023

📌 Commit 056c5b3 has been approved by cjgillot

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 Feb 22, 2023
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Feb 23, 2023
Make query keys `Copy`

This regressed compiler performance locally, so I'm curious what perf will say about it.

<table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check</td><td align="right">1.7566s</td><td align="right">1.7657s</td><td align="right"> 0.52%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.2572s</td><td align="right">0.2578s</td><td align="right"> 0.20%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">0.9863s</td><td align="right">0.9900s</td><td align="right"> 0.37%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">1.6018s</td><td align="right">1.6073s</td><td align="right"> 0.34%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check</td><td align="right">6.2493s</td><td align="right">6.2920s</td><td align="right"> 0.68%</td></tr><tr><td>Total</td><td align="right">10.8512s</td><td align="right">10.9127s</td><td align="right"> 0.57%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">1.0042s</td><td align="right"> 0.42%</td></tr></table>
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 24, 2023
Rollup of 10 pull requests

Successful merges:

 - rust-lang#106541 (implement const iterator using `rustc_do_not_const_check`)
 - rust-lang#106918 (Rebuild BinaryHeap on unwind from retain)
 - rust-lang#106923 (Restore behavior when primary bundle is missing)
 - rust-lang#108169 (Make query keys `Copy`)
 - rust-lang#108287 (Add test for bad cast with deferred projection equality)
 - rust-lang#108370 (std: time: Avoid to use "was created" in elapsed() description)
 - rust-lang#108377 (Fix ICE in 'duplicate diagnostic item' diagnostic)
 - rust-lang#108388 (parser: provide better suggestions and errors on closures with braces missing)
 - rust-lang#108391 (Fix `is_terminal`'s handling of long paths on Windows.)
 - rust-lang#108401 (diagnostics: remove inconsistent English article "this" from E0107)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 440113d into rust-lang:master Feb 24, 2023
@rustbot rustbot added this to the 1.69.0 milestone Feb 24, 2023
@Zoxc Zoxc deleted the query-key-copy branch February 24, 2023 23:51
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) 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