Skip to content

Use some more const_eval_select in pointer methods for compile times #106275

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

Merged

Conversation

Noratrieb
Copy link
Member

@Noratrieb Noratrieb commented Dec 29, 2022

Builds on top of #105435

is_aligned_to is huge with calling align_offset, so this should cut it down a lot.

This shows up in #65031 (comment)

@rustbot
Copy link
Collaborator

rustbot commented Dec 29, 2022

r? @m-ou-se

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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Dec 29, 2022
@Noratrieb
Copy link
Member Author

@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 Dec 29, 2022
@bors
Copy link
Collaborator

bors commented Dec 29, 2022

⌛ Trying commit 1c7fdaeea0a9966cfa87d2def47636959d90678d with merge 4fc6b4d7c103a94c6e79894303160403b3beeca1...

@Noratrieb
Copy link
Member Author

Let's hope that this doesn't confuse Bors too much but try has been running for over 25 min I don't know what it's doing

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Dec 29, 2022

⌛ Trying commit 3052798c191124eabd397316446b2df987a3d102 with merge fe347f2dc5aadae593fc3fdcac2347b9988ae96f...

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Dec 30, 2022

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (fe347f2dc5aadae593fc3fdcac2347b9988ae96f): 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)
16.2% [1.5%, 37.1%] 250
Regressions ❌
(secondary)
17.3% [1.7%, 77.6%] 270
Improvements ✅
(primary)
-2.5% [-2.5%, -2.5%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 16.1% [-2.5%, 37.1%] 251

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.9% [1.8%, 7.7%] 11
Regressions ❌
(secondary)
2.0% [0.9%, 3.4%] 6
Improvements ✅
(primary)
-3.8% [-10.7%, -0.1%] 11
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.5% [-10.7%, 7.7%] 22

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)
20.4% [2.2%, 47.1%] 249
Regressions ❌
(secondary)
22.4% [2.6%, 132.9%] 270
Improvements ✅
(primary)
-2.2% [-2.2%, -2.2%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 20.3% [-2.2%, 47.1%] 250

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Dec 30, 2022
@Noratrieb
Copy link
Member Author

Oh. Yeah. That's a regression I think. Turns out inlining kind of matters.

@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 Dec 30, 2022
@bors
Copy link
Collaborator

bors commented Dec 30, 2022

⌛ Trying commit 7dbee8317669d87aa145af7a17ff643bb3370c0d with merge 5e83a08343e2144d3281bbb0bd2a70927b4f6aa3...

@bors
Copy link
Collaborator

bors commented Dec 30, 2022

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5e83a08343e2144d3281bbb0bd2a70927b4f6aa3): comparison URL.

Overall result: ✅ improvements - 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.5% [0.3%, 0.7%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.4% [-1.0%, -0.2%] 58
Improvements ✅
(secondary)
-0.5% [-1.6%, -0.2%] 32
All ❌✅ (primary) -0.4% [-1.0%, 0.7%] 60

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)
3.4% [2.4%, 4.1%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.7% [-7.1%, -0.3%] 7
Improvements ✅
(secondary)
-3.5% [-3.5%, -3.5%] 1
All ❌✅ (primary) -1.6% [-7.1%, 4.1%] 10

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)
- - 0
Improvements ✅
(secondary)
-3.9% [-6.0%, -0.9%] 6
All ❌✅ (primary) - - 0

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 30, 2022
@rustbot rustbot removed the perf-regression Performance regression. label Dec 30, 2022
@Noratrieb
Copy link
Member Author

Noratrieb commented Dec 30, 2022

Looking very good, just like #105435 but even greener. The regex regression in compute_debuginfo_type_name is interesting, I'll investigate that. But overall, pretty good.
Edit: I wasn't quite able to figure out what exactly caused the regex regression

@Noratrieb Noratrieb force-pushed the const-eval-select-me-some-compile-time branch from 7dbee83 to a8f5045 Compare December 30, 2022 15:40
@Noratrieb Noratrieb changed the title [perf] Use some more const_eval_select in pointer methods for compile times Use some more const_eval_select in pointer methods for compile times Dec 30, 2022
@Noratrieb Noratrieb marked this pull request as ready for review December 30, 2022 15:41
@rustbot
Copy link
Collaborator

rustbot commented Dec 30, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@Noratrieb
Copy link
Member Author

r? thomcc

@thomcc
Copy link
Member

thomcc commented Dec 31, 2022

Thanks!

@bors r+

@bors
Copy link
Collaborator

bors commented Dec 31, 2022

📌 Commit a8f5045 has been approved by thomcc

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 Dec 31, 2022
@bors
Copy link
Collaborator

bors commented Dec 31, 2022

⌛ Testing commit a8f5045 with merge dd01a16...

@bors
Copy link
Collaborator

bors commented Dec 31, 2022

☀️ Test successful - checks-actions
Approved by: thomcc
Pushing dd01a16 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 31, 2022
@bors bors merged commit dd01a16 into rust-lang:master Dec 31, 2022
@rustbot rustbot added this to the 1.68.0 milestone Dec 31, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (dd01a16): 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.4% [0.4%, 0.4%] 1
Regressions ❌
(secondary)
0.7% [0.6%, 0.9%] 2
Improvements ✅
(primary)
-0.5% [-0.9%, -0.2%] 28
Improvements ✅
(secondary)
-0.8% [-0.8%, -0.7%] 3
All ❌✅ (primary) -0.4% [-0.9%, 0.4%] 29

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)
3.0% [2.3%, 3.5%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.3% [-4.6%, -0.2%] 9
Improvements ✅
(secondary)
-2.5% [-3.9%, -1.1%] 11
All ❌✅ (primary) -1.0% [-4.6%, 3.5%] 12

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)
2.9% [2.9%, 2.9%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.9% [-1.0%, -0.8%] 2
All ❌✅ (primary) - - 0

@rustbot rustbot added the perf-regression Performance regression. label Dec 31, 2022
@Noratrieb Noratrieb deleted the const-eval-select-me-some-compile-time branch December 31, 2022 21:34
@rylev
Copy link
Member

rylev commented Jan 3, 2023

As was pointed out here, the improvements outweigh the regressions so no need to investigate further.

@rustbot label +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Jan 3, 2023
Aaron1011 pushed a commit to Aaron1011/rust that referenced this pull request Jan 6, 2023
…compile-time, r=thomcc

Use some more `const_eval_select` in pointer methods for compile times

Builds on top of rust-lang#105435

`is_aligned_to` is _huge_ with calling `align_offset`, so this should cut it down a lot.

This shows up in rust-lang#65031 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants