Skip to content

[PERF CHECK ONLY] Add inline to trivial cross-crate accessors#156343

Draft
traviscross wants to merge 1 commit intorust-lang:mainfrom
traviscross:TC/add-inline-on-trivial-accessors
Draft

[PERF CHECK ONLY] Add inline to trivial cross-crate accessors#156343
traviscross wants to merge 1 commit intorust-lang:mainfrom
traviscross:TC/add-inline-on-trivial-accessors

Conversation

@traviscross
Copy link
Copy Markdown
Contributor

@traviscross traviscross commented May 8, 2026

View all comments

Note

This is a draft for running perf.

Small accessor functions aren't inlined across crate boundaries in all build configurations. Even with LTO, PGO, etc., we may be limited in what gets inlined without these annotations.

In detailed profiling, the inline attributes being added in this PR seemed to make a difference. Let's add them.

Notably, some of these fall within the expansion of the newtype_index! macro and will apply to the items it defines.

r? @traviscross

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 8, 2026
@traviscross
Copy link
Copy Markdown
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 8, 2026
rust-bors Bot pushed a commit that referenced this pull request May 8, 2026
…s, r=<try>

[PERF CHECK ONLY] Add `inline` to trivial cross-crate accessors
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 8, 2026

☀️ Try build successful (CI)
Build commit: 6000502 (6000502f00011b1e462abca902ad51df79f2d675, parent: 8068e2fc9afa8c888336b12db01987be768785f9)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (6000502): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
3.4% [3.4%, 3.4%] 1
Regressions ❌
(secondary)
1.2% [0.2%, 2.3%] 2
Improvements ✅
(primary)
-0.4% [-0.6%, -0.1%] 11
Improvements ✅
(secondary)
-0.9% [-1.0%, -0.8%] 6
All ❌✅ (primary) -0.1% [-0.6%, 3.4%] 12

Max RSS (memory usage)

Results (primary 1.4%, secondary 0.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.4% [1.4%, 1.4%] 1
Regressions ❌
(secondary)
3.2% [3.2%, 3.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.2% [-2.2%, -2.2%] 1
All ❌✅ (primary) 1.4% [1.4%, 1.4%] 1

Cycles

Results (secondary 2.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.8% [2.8%, 2.8%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 498.048s -> 501.772s (0.75%)
Artifact size: 397.10 MiB -> 397.12 MiB (0.00%)

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

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@traviscross traviscross force-pushed the TC/add-inline-on-trivial-accessors branch from 4873dc4 to 596a06f Compare May 8, 2026 23:20
@traviscross
Copy link
Copy Markdown
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 8, 2026
…s, r=<try>

[PERF CHECK ONLY] Add `inline` to trivial cross-crate accessors
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 8, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 9, 2026

💔 Test for fa3d3ef failed: CI

@traviscross
Copy link
Copy Markdown
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 9, 2026
…s, r=<try>

[PERF CHECK ONLY] Add `inline` to trivial cross-crate accessors
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 9, 2026

☀️ Try build successful (CI)
Build commit: c51601b (c51601be0e9654351a230f76a0910211ce8897a9, parent: fb0a5a5a9c892b351f34263d6d84da9dde72871a)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (c51601b): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
3.3% [3.3%, 3.3%] 1
Regressions ❌
(secondary)
0.8% [0.2%, 2.4%] 4
Improvements ✅
(primary)
-0.4% [-0.6%, -0.2%] 14
Improvements ✅
(secondary)
-0.4% [-1.1%, -0.1%] 20
All ❌✅ (primary) -0.1% [-0.6%, 3.3%] 15

Max RSS (memory usage)

Results (secondary 1.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.6% [2.3%, 3.0%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.2% [-3.2%, -3.2%] 1
All ❌✅ (primary) - - 0

Cycles

Results (primary -2.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.2% [-2.2%, -2.2%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.2% [-2.2%, -2.2%] 1

Binary size

Results (secondary -0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 1
All ❌✅ (primary) - - 0

Bootstrap: 497.93s -> 502.373s (0.89%)
Artifact size: 397.14 MiB -> 396.95 MiB (-0.05%)

@traviscross
Copy link
Copy Markdown
Contributor Author

@bors try parent=fb0a5a5a9c892b351f34263d6d84da9dde72871a @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 10, 2026
…s, r=<try>

[PERF CHECK ONLY] Add `inline` to trivial cross-crate accessors
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 10, 2026

💔 Test for 2b7c262 failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

@traviscross traviscross force-pushed the TC/add-inline-on-trivial-accessors branch 2 times, most recently from a52e013 to f091577 Compare May 10, 2026 09:04
@traviscross
Copy link
Copy Markdown
Contributor Author

@bors try parent=fb0a5a5a9c892b351f34263d6d84da9dde72871a @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 10, 2026
…s, r=<try>

[PERF CHECK ONLY] Add `inline` to trivial cross-crate accessors
@traviscross
Copy link
Copy Markdown
Contributor Author

@bors try cancel

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 10, 2026

Try build cancelled. Cancelled workflows:

@traviscross traviscross force-pushed the TC/add-inline-on-trivial-accessors branch from f091577 to 55e3e79 Compare May 10, 2026 09:31
@traviscross
Copy link
Copy Markdown
Contributor Author

@bors try parent=fb0a5a5a9c892b351f34263d6d84da9dde72871a @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 10, 2026
…s, r=<try>

[PERF CHECK ONLY] Add `inline` to trivial cross-crate accessors
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 10, 2026

☀️ Try build successful (CI)
Build commit: 7da34a2 (7da34a22b8c1391c23c4d12a1da5e05ba47427d5, parent: fb0a5a5a9c892b351f34263d6d84da9dde72871a)

@rust-timer

This comment has been minimized.

@rust-timer

This comment was marked as resolved.

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 10, 2026
@traviscross traviscross force-pushed the TC/add-inline-on-trivial-accessors branch from 55e3e79 to fdd8554 Compare May 10, 2026 12:15
@traviscross
Copy link
Copy Markdown
Contributor Author

@bors try parent=fb0a5a5a9c892b351f34263d6d84da9dde72871a @rust-timer queue

@rust-timer
Copy link
Copy Markdown
Collaborator

Awaiting bors try build completion.

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

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 10, 2026

⌛ Trying commit fdd8554 with merge 4a10250

To cancel the try build, run the command @bors try cancel.

Workflow: https://github.com/rust-lang/rust/actions/runs/25628483189

rust-bors Bot pushed a commit that referenced this pull request May 10, 2026
…s, r=<try>

[PERF CHECK ONLY] Add `inline` to trivial cross-crate accessors
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-perf Status: Waiting on a perf run to be completed. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants