Skip to content

Avoid the arena_cache modifier for several queries - #162105

Merged
rust-bors[bot] merged 7 commits into
rust-lang:mainfrom
Zalathar:arena-cache
Sep 6, 2026
Merged

Avoid the arena_cache modifier for several queries#162105
rust-bors[bot] merged 7 commits into
rust-lang:mainfrom
Zalathar:arena-cache

Conversation

@Zalathar

@Zalathar Zalathar commented Sep 1, 2026

Copy link
Copy Markdown
Member

View all comments

The arena_cache query modifier is convenient, but we can potentially avoid some overhead by allocating values into the central tcx.arena when possible.

There should be no change to compiler output.

@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 Sep 1, 2026
@Zalathar

Zalathar commented Sep 1, 2026

Copy link
Copy Markdown
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 Sep 1, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 1, 2026
Avoid the `arena_cache` modifier for several queries
@rust-bors

rust-bors Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 6f7d022 (6f7d022409d054eabfd477aad3fabdfbd1d91cbc)
Base parent: 7022271 (70222712809cd5cc1718ed8995914a1cbacb6b92)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (6f7d022): 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.3% [0.3%, 0.3%] 1
Regressions ❌
(secondary)
0.1% [0.1%, 0.2%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.3%, -0.1%] 5
All ❌✅ (primary) 0.3% [0.3%, 0.3%] 1

Max RSS (memory usage)

Results (primary -1.3%, secondary 0.2%)

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

mean range count
Regressions ❌
(primary)
1.1% [1.1%, 1.1%] 1
Regressions ❌
(secondary)
3.4% [0.8%, 6.7%] 9
Improvements ✅
(primary)
-1.5% [-3.4%, -0.7%] 10
Improvements ✅
(secondary)
-2.0% [-3.2%, -0.8%] 13
All ❌✅ (primary) -1.3% [-3.4%, 1.1%] 11

Cycles

Results (primary 2.4%, secondary 7.9%)

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)
7.9% [2.1%, 13.7%] 2
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: 475.539s -> 474.177s (-0.29%)
Artifact size: 400.59 MiB -> 400.51 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 Sep 1, 2026
@Zalathar

Zalathar commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Let's try another perf run on the same changes (rebased) to get a sense of whether those micro-regressions are noise or real.

@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 Sep 2, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 2, 2026
Avoid the `arena_cache` modifier for several queries
@rust-bors

This comment has been minimized.

@rust-bors

rust-bors Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 010d6dc (010d6dc97ceeb9ca121a70f1e97c204f1cbfc1ed)
Base parent: 5db7f4b (5db7f4be8a36c1b8ae19299469e2be2b0f052c21)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (010d6dc): 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.3% [0.3%, 0.3%] 1
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.2%, -0.1%] 4
All ❌✅ (primary) 0.3% [0.3%, 0.3%] 1

Max RSS (memory usage)

Results (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)
- - 0
Regressions ❌
(secondary)
3.7% [0.7%, 6.2%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.8% [-8.0%, -1.1%] 4
All ❌✅ (primary) - - 0

Cycles

Results (primary 3.6%, secondary -2.7%)

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

mean range count
Regressions ❌
(primary)
3.6% [2.9%, 4.5%] 6
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.7% [-2.7%, -2.7%] 1
All ❌✅ (primary) 3.6% [2.9%, 4.5%] 6

Binary size

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

Bootstrap: 475.082s -> 471.158s (-0.83%)
Artifact size: 400.59 MiB -> 400.40 MiB (-0.05%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 2, 2026
@Zalathar

Zalathar commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

As an experiment, let's try with only the subset of changes that use the dropless arena:

@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 Sep 2, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 2, 2026
Avoid the `arena_cache` modifier for several queries
@rust-bors

rust-bors Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 54e6c6c (54e6c6c04cc2470c1bc15d68c6b420b505075d4e)
Base parent: edc52f8 (edc52f87c28f328c61685a02c47887a5cec7d767)

@rust-timer

This comment has been minimized.

@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 Sep 5, 2026
@rust-bors rust-bors Bot 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 5, 2026
@rust-bors

This comment has been minimized.

@rustbot

rustbot commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@Zalathar

Zalathar commented Sep 6, 2026

Copy link
Copy Markdown
Member Author

Rebased, and PR CI is green.

@bors r=nnethercote

@rust-bors

rust-bors Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

📌 Commit be58a50 has been approved by nnethercote

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 6, 2026
@Zalathar

Zalathar commented Sep 6, 2026

Copy link
Copy Markdown
Member Author
  • The queue is mostly empty and this PR has been waiting for a few days now, so I'm going to put this ahead of Rollup of 2 pull requests #162347 on the assumption that we can make a bigger rollup later.

@bors p=5 (rollup=never ahead of small rollup)

@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 Sep 6, 2026
@rust-bors

rust-bors Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: nnethercote
Duration: 3h 8m 9s
Pushing dbad1ba to main...

@rust-bors
rust-bors Bot merged commit dbad1ba into rust-lang:main Sep 6, 2026
14 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 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 f248f40 (parent) -> dbad1ba (this PR)

Test differences

Show 190 test diffs

190 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 dbad1bab60868d49978b716635ac2c3203e327cf --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. dist-x86_64-solaris: 1h 3m -> 1h 42m (+61.0%)
  2. i686-gnu-nopt-1: 1h 31m -> 2h 26m (+59.9%)
  3. i686-gnu-1: 1h 43m -> 2h 23m (+38.2%)
  4. x86_64-msvc-2: 1h 50m -> 2h 30m (+36.4%)
  5. dist-ohos-aarch64: 1h 22m -> 53m 25s (-35.4%)
  6. x86_64-gnu-llvm-21-1: 38m 41s -> 50m 54s (+31.6%)
  7. dist-x86_64-freebsd: 1h 33m -> 1h 5m (-30.0%)
  8. x86_64-gnu-tools: 56m 1s -> 1h 12m (+29.3%)
  9. dist-x86_64-illumos: 1h 54m -> 1h 21m (-28.7%)
  10. optional-x86_64-gnu-autodiff: 43m 59s -> 56m 2s (+27.4%)
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.

@Zalathar
Zalathar deleted the arena-cache branch September 6, 2026 05:51
@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (dbad1ba): comparison URL.

Overall result: ❌✅ regressions and 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.2% [0.2%, 0.2%] 1
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.2%] 1
All ❌✅ (primary) 0.2% [0.2%, 0.2%] 1

Max RSS (memory usage)

Results (secondary -0.4%)

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)
4.1% [2.7%, 6.9%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.8% [-4.4%, -3.2%] 4
All ❌✅ (primary) - - 0

Cycles

Results (primary 3.0%, secondary 3.1%)

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

mean range count
Regressions ❌
(primary)
3.0% [2.7%, 3.4%] 2
Regressions ❌
(secondary)
3.1% [3.1%, 3.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.0% [2.7%, 3.4%] 2

Binary size

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

Bootstrap: 476.686s -> 478.423s (0.36%)
Artifact size: 403.40 MiB -> 403.41 MiB (0.00%)

@rustbot rustbot removed the perf-regression Performance regression. label Sep 6, 2026
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.

6 participants