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 QueryEngine trait #109611

Merged
merged 4 commits into from
Apr 30, 2023
Merged

Remove QueryEngine trait #109611

merged 4 commits into from
Apr 30, 2023

Conversation

Zoxc
Copy link
Contributor

@Zoxc Zoxc commented Mar 25, 2023

This removes the QueryEngine trait and Queries from rustc_query_impl and replaced them with function pointers and fields in QuerySystem. As a side effect OnDiskCache is moved back into rustc_middle and the OnDiskCache trait is also removed.

This has a couple of benefits.

r? @cjgillot

@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 Mar 25, 2023
@rustbot
Copy link
Collaborator

rustbot commented Mar 25, 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.

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

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

bors commented Mar 25, 2023

⌛ Trying commit 6ff4ec38724688fe2d03e6042a44db705454e11d with merge e917dc60af05173dcd1ddae988d3f4bd9ae00fab...

@bors
Copy link
Contributor

bors commented Mar 25, 2023

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e917dc60af05173dcd1ddae988d3f4bd9ae00fab): comparison URL.

Overall result: ❌✅ regressions and improvements - 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.0% [0.3%, 1.5%] 13
Regressions ❌
(secondary)
0.7% [0.3%, 2.2%] 19
Improvements ✅
(primary)
-2.7% [-3.5%, -0.2%] 5
Improvements ✅
(secondary)
-1.3% [-3.1%, -0.4%] 43
All ❌✅ (primary) -0.0% [-3.5%, 1.5%] 18

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.5% [0.4%, 0.5%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.0% [-2.2%, -0.4%] 7
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)
2.1% [1.8%, 2.4%] 3
Regressions ❌
(secondary)
1.4% [0.7%, 4.5%] 11
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.6% [-3.4%, -0.4%] 9
All ❌✅ (primary) 2.1% [1.8%, 2.4%] 3

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Mar 26, 2023
Comment on lines 231 to 233
// FIXME: This doesn't encode `did` directly due to some trait specialization error.
encode_def_id(did, encoder);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please include more information about the failure in the comment, as well as the code this should be so it gets addressed in the future

Copy link
Contributor

Choose a reason for hiding this comment

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

I had a look locally and found that using function syntax instead of method syntax works. I pushed the fix directly to your branch

@oli-obk
Copy link
Contributor

oli-obk commented Mar 27, 2023

Please have a look at the perf regressions with cachegrind. They seem ok, but we should at least make an attempt at resolving them.

the change itself lgtm.

@Zoxc
Copy link
Contributor Author

Zoxc commented Mar 28, 2023

It's not easy to read anything useful from cachegrind with lots of inlining differences and function renaming. I added inlining attributes to compensate for the OnDiskCache location change. It helps for unicode-normalization:check:unchanged locally at least.

@oli-obk
Copy link
Contributor

oli-obk commented Mar 28, 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 28, 2023
@bors
Copy link
Contributor

bors commented Mar 28, 2023

⌛ Trying commit b1ae7398814387a28fae32f91a0ee4d82d243eb0 with merge 0f23ca9ea2278f1bd63917535c55886c928388b4...

@bors
Copy link
Contributor

bors commented Mar 28, 2023

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0f23ca9ea2278f1bd63917535c55886c928388b4): comparison URL.

Overall result: ❌✅ regressions and improvements - 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)
0.5% [0.4%, 0.7%] 6
Regressions ❌
(secondary)
0.5% [0.3%, 0.6%] 6
Improvements ✅
(primary)
-2.8% [-2.9%, -2.6%] 4
Improvements ✅
(secondary)
-1.5% [-2.6%, -1.1%] 22
All ❌✅ (primary) -0.8% [-2.9%, 0.7%] 10

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.6% [2.8%, 4.3%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.4% [-3.1%, -1.7%] 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)
- - 0
Improvements ✅
(primary)
-2.5% [-3.5%, -1.6%] 5
Improvements ✅
(secondary)
-3.0% [-3.5%, -1.9%] 18
All ❌✅ (primary) -2.5% [-3.5%, -1.6%] 5

@Zoxc
Copy link
Contributor Author

Zoxc commented Mar 28, 2023

bitmaps seems to be a wall time improvement locally:

BenchmarkBeforeAfter
TimeTime%
🟣 bitmaps:check0.7687s0.7623s -0.83%
🟣 bitmaps:check:unchanged0.3960s0.3919s💚 -1.03%
Total1.1646s1.1542s -0.90%
Summary1.0000s0.9907s -0.93%

@oli-obk
Copy link
Contributor

oli-obk commented Apr 20, 2023

r? @cjgillot

@rustbot rustbot assigned cjgillot and unassigned oli-obk Apr 20, 2023
@bors
Copy link
Contributor

bors commented Apr 21, 2023

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

@bors
Copy link
Contributor

bors commented Apr 21, 2023

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

@bors
Copy link
Contributor

bors commented Apr 24, 2023

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

@bors
Copy link
Contributor

bors commented Apr 26, 2023

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

@cjgillot
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Apr 29, 2023

📌 Commit b694373 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 29, 2023
@bors
Copy link
Contributor

bors commented Apr 29, 2023

⌛ Testing commit b694373 with merge f5adff6...

@bors
Copy link
Contributor

bors commented Apr 30, 2023

☀️ Test successful - checks-actions
Approved by: cjgillot
Pushing f5adff6 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 30, 2023
@bors bors merged commit f5adff6 into rust-lang:master Apr 30, 2023
@rustbot rustbot added this to the 1.71.0 milestone Apr 30, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f5adff6): 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.3% [0.3%, 0.3%] 3
Improvements ✅
(primary)
-0.6% [-0.8%, -0.2%] 84
Improvements ✅
(secondary)
-0.8% [-1.5%, -0.4%] 32
All ❌✅ (primary) -0.6% [-0.8%, -0.2%] 84

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% [0.7%, 4.8%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.7% [-3.7%, -3.7%] 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)
- - 0
Improvements ✅
(primary)
-2.4% [-3.4%, -1.6%] 6
Improvements ✅
(secondary)
-3.0% [-3.5%, -2.1%] 15
All ❌✅ (primary) -2.4% [-3.4%, -1.6%] 6

@rustbot rustbot removed the perf-regression Performance regression. label Apr 30, 2023
@Zoxc Zoxc deleted the query-engine-rem branch April 30, 2023 06:04
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. 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