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

Add inlining attributes for query system functions #108375

Merged
merged 4 commits into from
Feb 26, 2023

Conversation

Zoxc
Copy link
Contributor

@Zoxc Zoxc commented Feb 23, 2023

These only have a single caller, but don't always get inlined.

@rustbot
Copy link
Collaborator

rustbot commented Feb 23, 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 23, 2023
@Kobzol
Copy link
Contributor

Kobzol commented Feb 23, 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 Feb 23, 2023
@bors
Copy link
Contributor

bors commented Feb 23, 2023

⌛ Trying commit b27826e76f00e789ffafd409fcd9ee25abbb67e5 with merge b621e618f35e198e1804feafe1b868837650200f...

@bors
Copy link
Contributor

bors commented Feb 23, 2023

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b621e618f35e198e1804feafe1b868837650200f): 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.3% [0.2%, 0.4%] 9
Regressions ❌
(secondary)
0.4% [0.1%, 2.6%] 22
Improvements ✅
(primary)
-0.8% [-0.9%, -0.7%] 2
Improvements ✅
(secondary)
-1.5% [-2.4%, -0.3%] 9
All ❌✅ (primary) 0.1% [-0.9%, 0.4%] 11

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

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Feb 23, 2023
@Zoxc Zoxc changed the title Always inline execute_job and get_query Add inlining attributes for query system functions Feb 24, 2023
@Zoxc
Copy link
Contributor Author

Zoxc commented Feb 24, 2023

I've added more inlining attribute after inspecting LLVM IR output. This is now also based on #108134.

The cumulative effect is now a performance win locally:

BenchmarkBeforeAfter
TimeTime%
🟣 clap:check:unchanged0.4699s0.4687s -0.26%
🟣 hyper:check:unchanged0.1359s0.1348s -0.84%
🟣 regex:check:unchanged0.3395s0.3382s -0.36%
🟣 syn:check:unchanged0.6333s0.6292s -0.65%
🟣 syntex_syntax:check:unchanged1.8633s1.8458s -0.94%
Total3.4419s3.4167s -0.73%
Summary1.0000s0.9939s -0.61%
BenchmarkBeforeAfter
TimeTime%
🟣 clap:check1.6962s1.6815s -0.86%
🟣 hyper:check0.2551s0.2550s -0.05%
🟣 regex:check0.9684s0.9578s💚 -1.10%
🟣 syn:check1.5518s1.5419s -0.64%
🟣 syntex_syntax:check5.9008s5.8854s -0.26%
Total10.3724s10.3217s -0.49%
Summary1.0000s0.9942s -0.58%

This could use another perf run now.

@lqd
Copy link
Member

lqd commented Feb 25, 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 Feb 25, 2023
@bors
Copy link
Contributor

bors commented Feb 25, 2023

⌛ Trying commit dd73080 with merge 0b48b07587a417881f1bff44bece1fbbe93f6b90...

@bors
Copy link
Contributor

bors commented Feb 25, 2023

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0b48b07587a417881f1bff44bece1fbbe93f6b90): 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.4% [0.2%, 0.5%] 2
Regressions ❌
(secondary)
0.4% [0.1%, 0.7%] 10
Improvements ✅
(primary)
-0.4% [-1.0%, -0.2%] 59
Improvements ✅
(secondary)
-0.4% [-0.7%, -0.2%] 20
All ❌✅ (primary) -0.4% [-1.0%, 0.5%] 61

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)
2.3% [2.3%, 2.3%] 1
Regressions ❌
(secondary)
4.3% [4.2%, 4.5%] 2
Improvements ✅
(primary)
-5.6% [-5.6%, -5.6%] 1
Improvements ✅
(secondary)
-3.0% [-3.7%, -2.3%] 2
All ❌✅ (primary) -1.7% [-5.6%, 2.3%] 2

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 25, 2023
@cjgillot
Copy link
Contributor

Perf is mostly green, and green on average.
@bors r+

@bors
Copy link
Contributor

bors commented Feb 25, 2023

📌 Commit dd73080 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 25, 2023
@bors
Copy link
Contributor

bors commented Feb 26, 2023

⌛ Testing commit dd73080 with merge 43ee4d1...

@bors
Copy link
Contributor

bors commented Feb 26, 2023

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 26, 2023
@bors bors merged commit 43ee4d1 into rust-lang:master Feb 26, 2023
@rustbot rustbot added this to the 1.69.0 milestone Feb 26, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (43ee4d1): 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
Regressions ❌
(secondary)
0.4% [0.2%, 0.7%] 5
Improvements ✅
(primary)
-0.4% [-1.1%, -0.2%] 38
Improvements ✅
(secondary)
-0.4% [-0.7%, -0.2%] 12
All ❌✅ (primary) -0.4% [-1.1%, -0.2%] 38

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)
-4.3% [-4.6%, -3.9%] 3
All ❌✅ (primary) - - 0

Cycles

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

@Zoxc Zoxc deleted the query-inline branch February 26, 2023 22:32
@pnkfelix
Copy link
Member

pnkfelix commented Mar 1, 2023

  • wins clearly outweigh losses here.
  • marking as triaged.

@rustbot label: perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Mar 1, 2023
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.

9 participants