Skip to content

Rollup of 7 perf-sensitive pull requests - #165244

Merged
rust-bors[bot] merged 28 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-qKlclC9
Nov 1, 2026
Merged

rust-bors[bot] merged 28 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-qKlclC9

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

nnethercote and others added 28 commits October 16, 2026 10:30
We can add ADTs to the early return check by avoiding the cases where
`coerce_unsized_info` can succeed with ADTs.

- It only succeeds if the ADTs are structs, which means we can return
  early for enums and unions.

- It only succeeds if the ADTs are the same struct but differ in a field
  type, which means we can return early for non-generic structs.
It currently wraps `coerce_unsized` but that function has a number of
early returns that don't need the `commit_if_ok`. This commit moves the
`commit_if_ok` inside of `coerce_unsized`, to wrap just the part that
needs it.
…econstruction, r=tmiasko

MIR move elimination [5/6]: Storage reconstruction

Depends on rust-lang#163338

This PR extends the `MoveElimination` pass from rust-lang/rfcs#3943 to reconstruct `StorageLive`/`StorageDead` statements for all locals by using the liveness information collected by `PreciseLiveness`.

r? tmiasko
…alization, r=dianqk

MIR move elimination [1.5/6]: Ensure ZSTs are always initialized

Split off from rust-lang#163335

The new MIR semantics from rust-lang/rfcs#3943 require that a local be initialized before it is used, since it only gains an allocation at that point. This means that ZSTs must be initialized before being read, even though the initialization is a no-op in codegen.

This PR addresses this in 2 ways:
- Adds missing ZST initializations in MIR shims and MIR intrinsic lowering.
- Restricts the `RemoveZsts` pass to only remove ZST assignments when the destination is indirect, since such places are required to already be allocated anyways. This is fine in practice since dead ZST assignments are later removed by DSE.

The last one also exposed a limitation in `SimplifyMatch`'s handling of constant equality when checking if two match arms are equivalent: it was only checking for scalar constants and was not handling `()` unit constants, which resulted in a test regression. The pass has been fixed to handle any kind of `ConstValue`.

r? tmiasko
…rochenkov

Move lang item collection to the resolver

The separate query had to walk the entire ast again, also tracking owners and converting NodeIds to DefIds. I think it's nicer to just do it as part of the resolver.

Alternatively we could limit the lang item collection to the local ones and keep the query. Instead of walking the current crate again we'd just take the list from the resolver query just like we take the list from upstream crates.
… r=BoxyUwU

do not prefer trivially true candidates with `-Znext-solver`

This is for the sake future compatibility, see https://rust-lang.zulipchat.com/#narrow/channel/144729-t-types/topic/resolving.20equal.20regions/near/623504310 for more background. Integrated changes to make this not cause any crater regression, see rust-lang#133502 (comment) where we did an accidental crater run only for this change.

I would generally like us to not be region dependent at all. For this we need the following:
- `stalled_on` shouldn't have to track region variables
- my hope is that we can yeet region uniquification once we have OR constraints

For this to work candidate merging has to always merge the region constraints of all candidates and can't rely on there being no region constraints. This in turn means that as long as there's an ambiguous candidate, we can't use another candidate which is known to hold, as the ambiguous candidate may end up resulting in fewer region constraints than the existing options.

This change does prevent us from discarding `HeadUsages` of other where-bounds if one where-bound holds without any constraints. This will cause hangs if we allow using a non-rigid `ParamEnv` for normalization in rust-lang/trait-system-refactor-initiative#210.

This also has annoying interactions with weakening impl shadowing. I am really unsure about the long-term plan here.  We may revert this change in the future because the tradeoff isn't worth it, unsure. By doing it for now we're future compatible with whatever we want to do.

The cycle handling tests are better tested by https://github.com/lcnr/search_graph_fuzz, having subtle cycle handling tests as ui tests is very brittle and very easily stops testing the right thing.

cc rust-lang/trait-system-refactor-initiative#305, see the added test

r? types
…eturn, r=ShoyuVanilla

Expand an early return case in `coerce_unsized`

Details in individual commits.

r? @lcnr
…nnethercote

Use adaptive sparse encoding for metadata tables

r? @nnethercote

I have added this implementation partially following the approach suggested in the existing FIXME comment.

Each 64-element block stores a cumulative count of preceding non-default values, enabling constant-time lookup by combining that count with a popcount of the bitmap bits before the requested position.

In local measurements, `.rmeta` file sizes decreased for all four crates in both Check and Release builds:

| Crate | Check reduction | Release reduction |
|---|---:|---:|
| tokio | 33.68% | 27.25% |
| tokio-util | 29.18% | 21.93% |
| serde_core | 34.45% | 18.37% |
| serde_json | 27.07% | 16.96% |

LLM disclosure: I used an LLM for some of the analysis in this PR.
destringlyfy lint infrastructure

Currently, lints are passed as strings and parsed/split/reformatted/compared/etc in many many places. It's not always clear whether that string includes the tool or not.

Instead, they are passed around as:
```rust
pub struct LintName {
    pub tool: Option<Symbol>,
    pub name: Symbol,
}
```

r? @JonathanBrouwer
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Oct 31, 2026
@rustbot rustbot added the A-attributes Area: Attributes (`#[…]`, `#![…]`) label Oct 31, 2026
@rustbot rustbot added the WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) label Oct 31, 2026
@JonathanBrouwer JonathanBrouwer changed the title Rollup of 7 pull requests Rollup of 7 perf-sensitive pull requests Oct 31, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors r+ p=5 force

Trying commonly failed jobs
@bors try jobs=dist-various-1,test-various,test-x86_64-gnu-aux,test-x86_64-msvc-1,test-x86_64-mingw-1,test-i686-msvc,test-armhf-gnu,test-x86_64-gnu-llvm-22-3,test-aarch64-msvc-2

@rust-bors

rust-bors Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 64a8aa5 has been approved by JonathanBrouwer

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 Oct 31, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 31, 2026
Rollup of 7 perf-sensitive pull requests


try-job: dist-various-1
try-job: test-various
try-job: test-x86_64-gnu-aux
try-job: test-x86_64-msvc-1
try-job: test-x86_64-mingw-1
try-job: test-i686-msvc
try-job: test-armhf-gnu
try-job: test-x86_64-gnu-llvm-22-3
try-job: test-aarch64-msvc-2
@rust-bors

This comment has been minimized.

@rust-bors

rust-bors Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 08ac975 (08ac97563042365e4187c96940edd70ff57f6435)
Base parent: 5a2a795 (5a2a7952ae19ceb9ee1056291a6a3ea9a998d844)

@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: JonathanBrouwer
Duration: 3h 3m 28s
Pushing 6fdaa71 to main...

@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 f9ceb4a (parent) -> 6fdaa71 (this PR)

Test differences

Show 92 test diffs

Stage 1

  • [ui (polonius)] tests/ui/traits/next-solver/assembly/item-bound-eq-modulo-placeholder-constraint.rs#current: [missing] -> pass (J0)
  • [ui (polonius)] tests/ui/traits/next-solver/assembly/item-bound-eq-modulo-placeholder-constraint.rs#next: [missing] -> pass (J0)
  • [ui (polonius)] tests/ui/traits/next-solver/cycles/inductive-cycle-but-ok.rs: pass -> [missing] (J0)
  • [ui (polonius)] tests/ui/traits/next-solver/cycles/inductive-cycle-discarded-coinductive-constraints.rs: pass -> [missing] (J0)
  • [mir-opt] tests/mir-opt/match_branch_simplification_zst.rs: [missing] -> pass (J1)
  • [mir-opt] tests/mir-opt/move-elimination/storage.rs: [missing] -> pass (J1)
  • [mir-opt] tests/mir-opt/move-elimination/storage_disabled.rs: [missing] -> pass (J1)
  • [mir-opt] tests/mir-opt/remove_zsts_move_elimination.rs: [missing] -> pass (J1)
  • [ui] tests/ui/traits/next-solver/assembly/item-bound-eq-modulo-placeholder-constraint.rs#current: [missing] -> pass (J2)
  • [ui] tests/ui/traits/next-solver/assembly/item-bound-eq-modulo-placeholder-constraint.rs#next: [missing] -> pass (J2)
  • [ui] tests/ui/traits/next-solver/cycles/inductive-cycle-but-ok.rs: pass -> [missing] (J2)
  • [ui] tests/ui/traits/next-solver/cycles/inductive-cycle-discarded-coinductive-constraints.rs: pass -> [missing] (J2)

Stage 2

  • [mir-opt] tests/mir-opt/match_branch_simplification_zst.rs: [missing] -> pass (J3)
  • [mir-opt] tests/mir-opt/move-elimination/storage.rs: [missing] -> pass (J3)
  • [mir-opt] tests/mir-opt/move-elimination/storage_disabled.rs: [missing] -> pass (J3)
  • [mir-opt] tests/mir-opt/remove_zsts_move_elimination.rs: [missing] -> pass (J3)
  • [ui] tests/ui/traits/next-solver/assembly/item-bound-eq-modulo-placeholder-constraint.rs#current: [missing] -> pass (J4)
  • [ui] tests/ui/traits/next-solver/assembly/item-bound-eq-modulo-placeholder-constraint.rs#next: [missing] -> pass (J4)
  • [ui] tests/ui/traits/next-solver/cycles/inductive-cycle-but-ok.rs: pass -> [missing] (J4)
  • [ui] tests/ui/traits/next-solver/cycles/inductive-cycle-discarded-coinductive-constraints.rs: pass -> [missing] (J4)

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

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 6fdaa715ca3b01ce517f3499d2396978fa413f5d --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-i686-gnu-nopt-2: 1h 27m -> 2h 33m (+75.2%)
  2. dist-x86_64-solaris: 1h 3m -> 1h 45m (+64.5%)
  3. test-x86_64-gnu-miri: 56m 58s -> 1h 27m (+53.8%)
  4. test-x86_64-rust-for-linux: 41m 3s -> 1h 2m (+51.6%)
  5. dist-arm-linux-gnueabi: 1h 4m -> 1h 35m (+48.5%)
  6. test-i686-gnu-nopt-1: 1h 41m -> 2h 28m (+46.3%)
  7. test-x86_64-msvc-ext1: 2h 22m -> 1h 19m (-44.2%)
  8. dist-powerpc64-linux-gnu: 1h 9m -> 1h 39m (+43.4%)
  9. test-x86_64-gnu-llvm-22-1: 58m 31s -> 1h 22m (+41.7%)
  10. dist-x86_64-mingw: 2h 44m -> 1h 44m (-36.7%)
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
Collaborator

Finished benchmarking commit (6fdaa71): comparison URL.

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

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

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.8% [0.3%, 4.2%] 25
Regressions ❌
(secondary)
0.9% [0.1%, 2.7%] 83
Improvements ✅
(primary)
-0.5% [-1.5%, -0.2%] 111
Improvements ✅
(secondary)
-0.6% [-2.3%, -0.1%] 102
All ❌✅ (primary) -0.3% [-1.5%, 4.2%] 136

Max RSS (memory usage)

Results (primary -3.8%, secondary -4.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)
4.7% [4.1%, 5.7%] 3
Improvements ✅
(primary)
-3.8% [-8.4%, -0.8%] 231
Improvements ✅
(secondary)
-4.3% [-8.9%, -1.1%] 188
All ❌✅ (primary) -3.8% [-8.4%, -0.8%] 231

Cycles

Results (primary 2.9%, secondary -2.6%)

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

mean range count
Regressions ❌
(primary)
2.9% [2.1%, 3.7%] 2
Regressions ❌
(secondary)
5.3% [4.2%, 6.2%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.4% [-11.9%, -2.5%] 13
All ❌✅ (primary) 2.9% [2.1%, 3.7%] 2

Binary size

Results (primary 0.6%, 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)
1.5% [0.1%, 7.2%] 14
Regressions ❌
(secondary)
3.9% [0.5%, 7.2%] 2
Improvements ✅
(primary)
-0.2% [-0.6%, -0.1%] 16
Improvements ✅
(secondary)
-0.1% [-0.4%, -0.1%] 12
All ❌✅ (primary) 0.6% [-0.6%, 7.2%] 30

Bootstrap: 492.484s -> 487.673s (-0.98%)
Artifact size: 406.61 MiB -> 406.63 MiB (0.01%)

@rustbot rustbot added the perf-regression Performance regression. label Nov 1, 2026
@rust-bors

rust-bors Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#163339 MIR move elimination [5/6]: Storage reconstruction 81111e9b3319991f3ea66135b987001ac908f6e8
(link)
#163359 MIR move elimination [1.5/6]: Ensure ZSTs are always initia… c00686cd30dfffda3bc72295583573b85d4bc6f0
(link)
#163525 Move lang item collection to the resolver b2696b21388c730c25eac0ee052eb44a7522af88
(link)
#163928 do not prefer trivially true candidates with `-Znext-solver… ba762b489783d16e461b5eec5ccef13408d64614
(link)
#164341 Expand an early return case in coerce_unsized a274b3878d994eda9eac73c3963814b8ffa2a9b5
(link)
#164484 Use adaptive sparse encoding for metadata tables e9522e30768ebf0b779e27bfe172b8c48426ab0c
(link)
#164607 destringlyfy lint infrastructure 0da2fc34007bc0273362d79d9c7d4103e04c2c2e
(link)

parent commit: f9ceb4a4d4

In the case of a perf regression, run the following command with the SHAs of each PR you suspect might be the cause: @rust-timer triage $SHA $SHA $SHA..., or run @rust-timer triage all to benchmark all rollup members.

@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@rust-timer triage all

@rust-timer

rust-timer commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator
Running triage with 57 benchmarks

Triage only executes the benchmarks on rollup members, that were changed significantly on the rollup.
For this rollup, these benchmarks are:

  • await-call-tree
  • bitmaps-3.2.1
  • bitmaps-3.2.1-new-solver
  • cargo-0.87.1
  • clap_derive-4.5.32
  • clap_derive-4.5.32-nll
  • coercions
  • cranelift-codegen-0.119.0
  • ctfe-stress-5
  • deep-vector
  • deeply-nested-multi
  • deref-sidebar-stress
  • derive
  • diesel-2.2.10
  • diesel-2.2.10-new-solver
  • enum-stress
  • externs
  • eza-0.21.2
  • helloworld
  • helloworld-tiny
  • html5ever-0.31.0
  • html5ever-0.31.0-new-solver
  • hyper-1.6.0
  • image-0.25.6
  • include-blob
  • issue-46449
  • issue-58319
  • issue-88862
  • large-workspace
  • many-assoc-items
  • nalgebra-0.33.0
  • projection-caching
  • regex-automata-0.4.8
  • regression-31157
  • ripgrep-14.1.1
  • ripgrep-14.1.1-nll
  • ripgrep-14.1.1-tiny
  • serde-1.0.219
  • serde-1.0.219-new-solver
  • serde-1.0.219-nll
  • serde_derive-1.0.219
  • stm32f4-0.15.1
  • syn-2.0.101
  • syn-2.0.101-new-solver
  • token-stream-stress
  • tokio-1.53.1
  • tt-muncher
  • tuple-stress
  • typenum-1.18.0
  • typenum-1.18.0-new-solver
  • ucd
  • unicode-normalization-0.1.24
  • unify-linearly
  • unused-warnings
  • wf-projection-stress-65510
  • wg-grammar
  • wg-grammar-new-solver

#163339 81111e9 MIR move elimination [5/6]: Storage reconstruction

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

Max RSS (memory usage)

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

Cycles

Results (primary 0.9%, 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)
2.4% [1.7%, 3.2%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.2% [-2.2%, -2.2%] 1
Improvements ✅
(secondary)
-2.7% [-2.7%, -2.7%] 1
All ❌✅ (primary) 0.9% [-2.2%, 3.2%] 3

Binary size

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


#163359 c00686c MIR move elimination [1.5/6]: Ensure ZSTs are always initialized

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.8% [0.2%, 4.2%] 13
Regressions ❌
(secondary)
0.4% [0.0%, 2.6%] 19
Improvements ✅
(primary)
-0.4% [-0.6%, -0.2%] 2
Improvements ✅
(secondary)
-0.6% [-0.6%, -0.6%] 1
All ❌✅ (primary) 0.7% [-0.6%, 4.2%] 15

Max RSS (memory usage)

Results (primary -1.5%, secondary 1.6%)

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

mean range count
Regressions ❌
(primary)
2.2% [2.2%, 2.4%] 3
Regressions ❌
(secondary)
4.2% [2.6%, 7.3%] 3
Improvements ✅
(primary)
-5.3% [-6.7%, -3.1%] 3
Improvements ✅
(secondary)
-2.3% [-3.6%, -0.9%] 2
All ❌✅ (primary) -1.5% [-6.7%, 2.4%] 6

Cycles

Results (primary 3.8%, secondary -0.7%)

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

mean range count
Regressions ❌
(primary)
3.8% [3.2%, 4.4%] 2
Regressions ❌
(secondary)
2.1% [2.1%, 2.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.5% [-3.5%, -3.5%] 1
All ❌✅ (primary) 3.8% [3.2%, 4.4%] 2

Binary size

Results (primary 0.8%, secondary 0.6%)

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

mean range count
Regressions ❌
(primary)
1.5% [0.1%, 7.2%] 14
Regressions ❌
(secondary)
3.9% [0.5%, 7.2%] 2
Improvements ✅
(primary)
-0.1% [-0.4%, -0.1%] 10
Improvements ✅
(secondary)
-0.1% [-0.4%, -0.1%] 9
All ❌✅ (primary) 0.8% [-0.4%, 7.2%] 24

#163525 b2696b2 Move lang item collection to the resolver

Queued b2696b2 with parent f9ceb4a, future comparison URL.
There are currently 2 preceding artifacts in the queue.
It will probably take at least ~2.3 hours until the benchmark run finishes.


#163928 ba762b4 do not prefer trivially true candidates with -Znext-solver

Queued ba762b4 with parent f9ceb4a, future comparison URL.
There are currently 3 preceding artifacts in the queue.
It will probably take at least ~3.1 hours until the benchmark run finishes.


#164341 a274b38 Expand an early return case in coerce_unsized

Queued a274b38 with parent f9ceb4a, future comparison URL.
There are currently 4 preceding artifacts in the queue.
It will probably take at least ~3.8 hours until the benchmark run finishes.


#164484 e9522e3 Use adaptive sparse encoding for metadata tables

Queued e9522e3 with parent f9ceb4a, future comparison URL.
There are currently 5 preceding artifacts in the queue.
It will probably take at least ~4.6 hours until the benchmark run finishes.


#164607 0da2fc3 destringlyfy lint infrastructure

Queued 0da2fc3 with parent f9ceb4a, future comparison URL.
There are currently 6 preceding artifacts in the queue.
It will probably take at least ~5.4 hours until the benchmark run finishes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-run-make Area: port run-make Makefiles to rmake.rs merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. rollup A PR which is a rollup T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants