Skip to content

Inline derived hash #111963

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
merged 2 commits into from
May 29, 2023
Merged

Inline derived hash #111963

merged 2 commits into from
May 29, 2023

Conversation

nnethercote
Copy link
Contributor

Because most of the other derived functions are inlined: clone, default, eq, partial_cmp, cmp. The exception is fmt, but it tends to not be on hot paths as much.

r? @ghost

Because most of the other derived functions are inlined: `clone`,
`default`, `eq`, `partial_cmp`, `cmp`. The exception is `fmt`, but it
tends to not be on hot paths as much.
@rustbot rustbot added 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 May 25, 2023
@nnethercote
Copy link
Contributor 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 May 25, 2023
@bors
Copy link
Collaborator

bors commented May 25, 2023

⌛ Trying commit ee013d8 with merge 29ad02403082e1450e94f7468938e49f768cd36c...

@bors
Copy link
Collaborator

bors commented May 25, 2023

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

1 similar comment
@bors
Copy link
Collaborator

bors commented May 25, 2023

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (29ad02403082e1450e94f7468938e49f768cd36c): 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.7% [0.6%, 0.9%] 6
Regressions ❌
(secondary)
1.4% [1.4%, 1.4%] 3
Improvements ✅
(primary)
-0.3% [-0.9%, -0.2%] 46
Improvements ✅
(secondary)
-0.4% [-0.7%, -0.2%] 19
All ❌✅ (primary) -0.2% [-0.9%, 0.9%] 52

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)
4.2% [4.2%, 4.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.4% [-3.4%, -3.4%] 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)
-1.1% [-1.2%, -1.0%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.1% [-1.2%, -1.0%] 3

Binary size

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.3% [0.3%, 0.3%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.5% [-1.0%, -0.2%] 9
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.4% [-1.0%, 0.3%] 10

Bootstrap: 648.599s -> 646.184s (-0.37%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels May 25, 2023
@nnethercote
Copy link
Contributor Author

Looks to be a slight perf win, and the added consistency is good.

r? @lqd

@lqd
Copy link
Member

lqd commented May 26, 2023

This makes sense to me, and could likely be a codegen improvement in runtime benchmarks (some of which it seems we're seeing in rustc's check builds).

I'm not sure why inlining impacts ctfe-stress-5 here per se, and cg attributes it to <rustc_middle::ty::context::TyCtxt>::try_subst_and_normalize_erasing_regions::<rustc_middle::mir::ConstantKind>. I don't know if you wanted to investigate this more even if it's a secondary benchmark, or if the wins outweighing the losses is enough.

Some of the other regressions (e.g. on diesel) look like the usual obligations/folding processing code inlining shuffle.

Otherwise, r=me.

@nnethercote
Copy link
Contributor Author

@bors r=lqd

@bors
Copy link
Collaborator

bors commented May 28, 2023

📌 Commit ee013d8 has been approved by lqd

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 May 28, 2023
@bors
Copy link
Collaborator

bors commented May 29, 2023

⌛ Testing commit ee013d8 with merge f8447b9...

@bors
Copy link
Collaborator

bors commented May 29, 2023

☀️ Test successful - checks-actions
Approved by: lqd
Pushing f8447b9 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 29, 2023
@bors bors merged commit f8447b9 into rust-lang:master May 29, 2023
@rustbot rustbot added this to the 1.72.0 milestone May 29, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f8447b9): 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.3% [0.3%, 0.3%] 1
Regressions ❌
(secondary)
0.5% [0.2%, 0.6%] 15
Improvements ✅
(primary)
-0.3% [-0.6%, -0.2%] 16
Improvements ✅
(secondary)
-0.7% [-1.4%, -0.3%] 21
All ❌✅ (primary) -0.2% [-0.6%, 0.3%] 17

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

mean range count
Regressions ❌
(primary)
3.4% [0.8%, 6.1%] 10
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.4% [0.8%, 6.1%] 10

Binary size

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.2% [-0.2%, -0.2%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-0.2%, -0.2%] 3

Bootstrap: 646.979s -> 644.623s (-0.36%)

@nnethercote nnethercote deleted the inline-derived-hash branch May 30, 2023 09:03
@nnethercote
Copy link
Contributor Author

Lots of small perf changes, but the improvement slightly outweigh the regressions.

@rustbot label: +perf-regression-triaged

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

5 participants