Improve canonicalization performance by introducing TypingMode::ErasedNotCoherence#155443
Improve canonicalization performance by introducing TypingMode::ErasedNotCoherence#155443jdonszelmann wants to merge 11 commits intorust-lang:mainfrom
TypingMode::ErasedNotCoherence#155443Conversation
|
@bors try |
This comment has been minimized.
This comment has been minimized.
|
@bors try parent=14196dbfa3eb7c30195251eac092b1b86c8a2d84 |
This comment has been minimized.
This comment has been minimized.
[DO NOT MERGE] Improve canonicalization performance
|
@rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (db1df07): 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 @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -0.9%, secondary 1.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -2.4%, secondary 28.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 491.114s -> 492.029s (0.19%) |
|
changes to the core type system cc @lcnr Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred to the CTFE machinery Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
TypingMode::ErasedNotCoherence
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
The job Click to see the possible cause of the failure (guessed by this bot)For more information how to resolve CI failures of this job, visit this link. |
|
@bors try @rust-timer queue |
|
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
|
⌛ Trying commit dd5b434 with merge 0a137a1… To cancel the try build, run the command Workflow: https://github.com/rust-lang/rust/actions/runs/25226911955 |
Improve canonicalization performance by introducing `TypingMode::ErasedNotCoherence`
|
@rust-timer cancel |
|
Command cannot be empty |
|
@bors try cancel |
|
Try build cancelled. Cancelled workflows: |
|
☔ The latest upstream changes (presumably #156072) made this pull request unmergeable. Please resolve the merge conflicts. |
View all comments
r? @lcnr
This introduces
TypingMode::ErasedNotCoherence. Most typing modes contain a list of opaque types, which are quite often unused during canonicalization. With this change, any time we try canonicalization, we replace whichever typing mode we're currently in withErasedNotcoherence, attempt to canonicalize, and if that fails retry in the original typing mode. If erased mode succeeds, this is beneficial because that way the opaque types don't end up in the cache key, allowing more cache reuse.This seems to have a small (0.5%) slowdown on most programs, but a dramatic (>60%) speedup in specific cases like the rustc-perf
wg-grammarbenchmark. Some more improvements are expected with "eager normalization", which is work that's under way right now.