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

Use function pointers instead of macro-unrolled loops in rustc_query_impl #101785

Merged
merged 1 commit into from
Sep 26, 2022

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Sep 14, 2022

By making these standalone functions, we
a) allow making them extensible in the future with a new QueryStruct
b) greatly decrease the amount of code in each individual function, avoiding exponential blowup in llvm

Helps with #96524. Based on #101173; only the last commit is relevant.

r? @cjgillot

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 14, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 14, 2022
@jyn514
Copy link
Member Author

jyn514 commented Sep 14, 2022

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 14, 2022
@bors
Copy link
Contributor

bors commented Sep 14, 2022

⌛ Trying commit 8d113ae658eec2feb3a5be0a782eabbfacfb0f2b with merge 98f9eb27dc66cd8fc5cc582c9e65d58a407ed646...

@bors
Copy link
Contributor

bors commented Sep 14, 2022

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

@rust-timer
Copy link
Collaborator

Queued 98f9eb27dc66cd8fc5cc582c9e65d58a407ed646 with parent 17cbdfd, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (98f9eb27dc66cd8fc5cc582c9e65d58a407ed646): comparison URL.

Overall result: no relevant changes - 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-review -S-waiting-on-perf -perf-regression

Instruction count

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

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.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.0% [4.0%, 4.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

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

Footnotes

  1. the arithmetic mean of the percent change

  2. number of relevant changes

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 14, 2022
@jyn514 jyn514 force-pushed the query-struct-fn-ptrs branch 3 times, most recently from df4c1c0 to ef6752e Compare September 25, 2022 16:11
…impl

By making these standalone functions, we
a) allow making them extensible in the future with a new `QueryStruct`
b) greatly decrease the amount of code in each individual function, avoiding exponential blowup in llvm
@jyn514 jyn514 force-pushed the query-struct-fn-ptrs branch from ef6752e to 7a83690 Compare September 25, 2022 16:27
@cjgillot
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Sep 25, 2022

📌 Commit 7a83690 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 Sep 25, 2022
@bors
Copy link
Contributor

bors commented Sep 26, 2022

⌛ Testing commit 7a83690 with merge 3288d3a...

@bors
Copy link
Contributor

bors commented Sep 26, 2022

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 26, 2022
@bors bors merged commit 3288d3a into rust-lang:master Sep 26, 2022
@rustbot rustbot added this to the 1.66.0 milestone Sep 26, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3288d3a): 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.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.2% [1.2%, 1.2%] 2
Improvements ✅
(primary)
-0.4% [-0.4%, -0.4%] 1
Improvements ✅
(secondary)
-1.1% [-1.5%, -0.6%] 9
All ❌✅ (primary) -0.4% [-0.4%, -0.4%] 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.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.2% [2.2%, 4.5%] 3
Improvements ✅
(primary)
-2.0% [-2.0%, -2.0%] 1
Improvements ✅
(secondary)
-1.9% [-2.9%, -1.6%] 4
All ❌✅ (primary) -2.0% [-2.0%, -2.0%] 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.

mean1 range count2
Regressions ❌
(primary)
2.7% [2.5%, 3.0%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.7% [2.5%, 3.0%] 2

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot added the perf-regression Performance regression. label Sep 26, 2022
@nnethercote
Copy link
Contributor

The pre-merge perf run had no significant results, and the post-merge one has only a few significant results, with the improvements slightly outweighing the regressions.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Sep 26, 2022
@jyn514 jyn514 deleted the query-struct-fn-ptrs branch September 26, 2022 13:57
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-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.

7 participants