Skip to content

De-inline interned span ops - #165124

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
nnethercote:deinline-interned-span-ops
Nov 1, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
nnethercote:deinline-interned-span-ops

Conversation

@nnethercote

@nnethercote nnethercote commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

View all comments

Interned spans are rare, and interned lookups are complex, involving TLS lookups and locking. This commit moves them out of line from Interned::data (affecting several Span operations), plus Span::is_dummy, Span::parent. This makes them match Span::new_ordered, which already has the interned case out of line.

This reduces rustc binary size and is a very small perf win.

r? @petrochenkov

@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 Oct 29, 2026
@nnethercote

Copy link
Copy Markdown
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 Oct 29, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 29, 2026
@rust-bors

This comment has been minimized.

@rust-bors

rust-bors Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: f92e042 (f92e042d034fa7461824dfcc5a56d7284f1c9dc1)
Base parent: ce37c4f (ce37c4ff837c5c5dc45cddf9e1e3704e42ca67ea)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown

Finished benchmarking commit (f92e042): comparison URL.

Overall result: ❌ regressions - 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 rustc-perf
@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)
0.2% [0.1%, 0.4%] 58
Regressions ❌
(secondary)
0.3% [0.1%, 0.6%] 48
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [0.1%, 0.4%] 58

Max RSS (memory usage)

Results (primary -0.4%, secondary -1.5%)

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

mean range count
Regressions ❌
(primary)
0.5% [0.4%, 0.6%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.7% [-1.1%, -0.5%] 7
Improvements ✅
(secondary)
-1.5% [-2.2%, -0.8%] 2
All ❌✅ (primary) -0.4% [-1.1%, 0.6%] 10

Cycles

Results (primary 0.8%, secondary 0.0%)

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

mean range count
Regressions ❌
(primary)
1.1% [0.4%, 2.4%] 12
Regressions ❌
(secondary)
1.6% [0.6%, 2.6%] 2
Improvements ✅
(primary)
-1.0% [-1.1%, -0.9%] 2
Improvements ✅
(secondary)
-3.1% [-3.1%, -3.1%] 1
All ❌✅ (primary) 0.8% [-1.1%, 2.4%] 14

Binary size

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

Bootstrap: 490.291s -> 495.231s (1.01%)
Artifact size: 406.63 MiB -> 406.72 MiB (0.02%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Oct 29, 2026
Interned spans are rare, and interned lookups are complex, involving TLS
lookups and locking. This commit moves them out of line from
`Interned::data` (affecting several `Span` operations), plus
`Span::is_dummy`, `Span::parent`. This makes them match
`Span::new_ordered`, which already has the interned case out of line.

This reduces rustc binary size and is a very small perf win.
@nnethercote
nnethercote force-pushed the deinline-interned-span-ops branch from 6637d85 to 27053d2 Compare October 29, 2026 23:52
@nnethercote

Copy link
Copy Markdown
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 Oct 29, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 29, 2026
@rust-bors

This comment has been minimized.

@rust-bors

rust-bors Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 92a0ae6 (92a0ae677d90e05db9aec457be3c73efff6d7be2)
Base parent: 92b5b8c (92b5b8c87c61b20adc9001b41baf587634a74734)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown

Finished benchmarking commit (92a0ae6): 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 rustc-perf
@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)
- - 0
Regressions ❌
(secondary)
0.2% [0.1%, 0.3%] 13
Improvements ✅
(primary)
-0.2% [-0.2%, -0.1%] 13
Improvements ✅
(secondary)
-0.3% [-0.4%, -0.3%] 4
All ❌✅ (primary) -0.2% [-0.2%, -0.1%] 13

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

Cycles

Results (primary 2.4%)

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

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

Binary size

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

Bootstrap: 484.843s -> 488.368s (0.73%)
Artifact size: 406.61 MiB -> 406.75 MiB (0.04%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 30, 2026
@nnethercote
nnethercote marked this pull request as ready for review October 30, 2026 04:14
@nnethercote

Copy link
Copy Markdown
Contributor Author

The second perf run is slightly positive, and the elimination of the with_span_interner duplication is nice, and I saw binary size reductions locally (without PGO). So I think this just ticks over into "worth merging".

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 30, 2026
@petrochenkov

Copy link
Copy Markdown
Contributor

@bors r+

@rust-bors

rust-bors Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 27053d2 has been approved by petrochenkov

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Nov 1, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Nov 1, 2026
…rochenkov

De-inline interned span ops

Interned spans are rare, and interned lookups are complex, involving TLS lookups and locking. This commit moves them out of line from `Interned::data` (affecting several `Span` operations), plus `Span::is_dummy`, `Span::parent`. This makes them match `Span::new_ordered`, which already has the interned case out of line.

This reduces rustc binary size and is a very small perf win.

r? @petrochenkov
@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 1, 2026
@rust-bors

rust-bors Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 41c525f failed: CI. Failed job:

@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors retry

@rust-bors rust-bors Bot 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 Nov 1, 2026
@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 1, 2026
@rust-bors

rust-bors Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: petrochenkov
Duration: 2h 52m 42s
Pushing 3b5aab2 to main...

@rust-bors
rust-bors Bot merged commit 3b5aab2 into rust-lang:main Nov 1, 2026
16 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor
What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 349bba6 (parent) -> 3b5aab2 (this PR)

Test differences

Show 2 test diffs

2 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 3b5aab2cea0711a2cc87a5a71338b5dba241b6a9 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. test-aarch64-apple-macos-26-1: 5h 53m -> 2h 14m (-62.0%)
  2. test-x86_64-gnu-gcc-core-tests: 19m 19s -> 9m 27s (-51.1%)
  3. test-x86_64-gnu-aux: 2h 47m -> 1h 26m (-48.3%)
  4. test-x86_64-gnu-stdlib-semver-check: 13m 35s -> 7m 37s (-43.9%)
  5. test-x86_64-gnu-debug: 2h 14m -> 1h 18m (-41.5%)
  6. test-x86_64-msvc-ext3: 1h 55m -> 1h 7m (-41.2%)
  7. test-pr-check-2: 38m 34s -> 22m 51s (-40.8%)
  8. test-i686-gnu-2: 1h 10m -> 1h 34m (+33.5%)
  9. test-x86_64-gnu-llvm-22: 1h -> 41m 3s (-32.3%)
  10. dist-riscv64-linux-musl: 1h 32m -> 1h 2m (-32.1%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer

Copy link
Copy Markdown

Finished benchmarking commit (3b5aab2): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -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)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.1% [-0.1%, -0.1%] 1
Improvements ✅
(secondary)
-0.3% [-0.4%, -0.3%] 3
All ❌✅ (primary) -0.1% [-0.1%, -0.1%] 1

Max RSS (memory usage)

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

Cycles

Results (primary -3.3%, secondary 15.3%)

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)
15.3% [7.0%, 23.5%] 2
Improvements ✅
(primary)
-3.3% [-3.3%, -3.3%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -3.3% [-3.3%, -3.3%] 1

Binary size

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

Bootstrap: 493.204s -> 487.913s (-1.07%)
Artifact size: 406.65 MiB -> 406.78 MiB (0.03%)

@rustbot rustbot removed the perf-regression Performance regression. label Nov 1, 2026
@nnethercote
nnethercote deleted the deinline-interned-span-ops branch November 2, 2026 05:40
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. 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