Skip to content

Automatic #[inline] for trivial wrappers #116898

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

Closed
wants to merge 1 commit into from

Conversation

saethlin
Copy link
Member

r? @ghost

@saethlin saethlin added the S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. label Oct 18, 2023
@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 Oct 18, 2023
@saethlin
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 Oct 18, 2023
@saethlin saethlin added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Oct 18, 2023
@rust-log-analyzer

This comment has been minimized.

@saethlin saethlin force-pushed the inline-trivial-wrappers branch from 70e1f67 to 92837ec Compare October 18, 2023 18:26
@saethlin
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 Oct 18, 2023
@saethlin
Copy link
Member Author

@bors try

@bors
Copy link
Collaborator

bors commented Oct 18, 2023

⌛ Trying commit 92837ec with merge c00e9cf...

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 18, 2023
…<try>

Automatic #[inline] for trivial wrappers

r? `@ghost`
@bors
Copy link
Collaborator

bors commented Oct 18, 2023

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c00e9cf): 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)
2.6% [0.2%, 55.1%] 37
Regressions ❌
(secondary)
1.7% [0.7%, 2.4%] 8
Improvements ✅
(primary)
-0.9% [-2.3%, -0.3%] 13
Improvements ✅
(secondary)
-0.5% [-0.6%, -0.5%] 5
All ❌✅ (primary) 1.7% [-2.3%, 55.1%] 50

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.8% [0.7%, 6.4%] 6
Regressions ❌
(secondary)
2.7% [1.7%, 4.2%] 4
Improvements ✅
(primary)
-4.8% [-9.9%, -1.6%] 6
Improvements ✅
(secondary)
-2.2% [-3.5%, -0.9%] 3
All ❌✅ (primary) -0.5% [-9.9%, 6.4%] 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)
4.9% [0.9%, 56.3%] 19
Regressions ❌
(secondary)
2.1% [1.7%, 2.5%] 4
Improvements ✅
(primary)
-1.2% [-2.0%, -0.9%] 6
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.4% [-2.0%, 56.3%] 25

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.5% [0.0%, 4.2%] 69
Regressions ❌
(secondary)
1.3% [0.2%, 3.1%] 13
Improvements ✅
(primary)
-0.7% [-2.3%, -0.0%] 31
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [-2.3%, 4.2%] 100

Bootstrap: 628.593s -> 628.523s (-0.01%)
Artifact size: 303.98 MiB -> 304.18 MiB (0.07%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Oct 18, 2023
@saethlin saethlin force-pushed the inline-trivial-wrappers branch from 92837ec to 3c388ba Compare November 10, 2023 17:55
@saethlin
Copy link
Member Author

This may have changed since we now add #[inline] to derived Debug impls
@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 Nov 10, 2023
@bors
Copy link
Collaborator

bors commented Nov 10, 2023

⌛ Trying commit 3c388ba with merge 1dbed32...

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 10, 2023
…<try>

Automatic #[inline] for trivial wrappers

r? `@ghost`
@bors
Copy link
Collaborator

bors commented Nov 10, 2023

☀️ Try build successful - checks-actions
Build commit: 1dbed32 (1dbed32e70384502904754e9029f18700d75b030)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1dbed32): 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)
2.6% [0.1%, 55.5%] 37
Regressions ❌
(secondary)
1.5% [0.4%, 2.5%] 9
Improvements ✅
(primary)
-0.8% [-2.2%, -0.3%] 11
Improvements ✅
(secondary)
-0.7% [-1.7%, -0.4%] 8
All ❌✅ (primary) 1.8% [-2.2%, 55.5%] 48

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)
1.6% [0.4%, 4.7%] 19
Regressions ❌
(secondary)
3.7% [1.1%, 8.4%] 4
Improvements ✅
(primary)
-2.1% [-7.2%, -0.5%] 11
Improvements ✅
(secondary)
-2.9% [-4.9%, -1.3%] 6
All ❌✅ (primary) 0.3% [-7.2%, 4.7%] 30

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.9% [0.4%, 56.6%] 23
Regressions ❌
(secondary)
2.2% [1.1%, 2.8%] 11
Improvements ✅
(primary)
-1.0% [-2.1%, -0.4%] 9
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.5% [-2.1%, 56.6%] 32

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.5% [0.0%, 3.1%] 54
Regressions ❌
(secondary)
1.1% [0.2%, 2.2%] 12
Improvements ✅
(primary)
-0.7% [-2.5%, -0.0%] 39
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.0% [-2.5%, 3.1%] 93

Bootstrap: 674.395s -> 672.993s (-0.21%)
Artifact size: 311.13 MiB -> 311.35 MiB (0.07%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 11, 2023
@Dylan-DPC Dylan-DPC removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Nov 16, 2023
@saethlin
Copy link
Member Author

I am leaving the same comment here and on #112255.

I'm closing this because I think this has unsolvable (with our current tooling) compile time performance issues.

I think the performance regressions are driven by increasing the connectivity of the incremental compilation dependency graph. The primary effect of MIR optimizations is to decrease compile times by making less work for LLVM, but if we make builds less incremental in order to produce less IR overall, this is working against itself to improve debug build times.

This tension between MIR optimizations enabled by inlining and incremental build granularity may be solvable by computing the MIR call graph ahead of time and consulting the graph in the MIR inliner to find inlining opportunities that do not significantly increase the connectivity of the graph. But implementing that is beyond me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. 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.

6 participants