Skip to content

perf: remove cache in TypeRelating - #166454

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
scrabsha:perf/remove-cache-type-relating
Nov 25, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
scrabsha:perf/remove-cache-type-relating

Conversation

@scrabsha

@scrabsha scrabsha commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

removing this cache gives us 0.11% - 0.21% IC reduction on some primary benchmarks and up to 0.46% IC reduction on secondary benchmarks.

this cache was introduced in #130821 to address a hang. none of the tests added in this PR hang anymore after removing the cache.

r? @nnethercote

Note

AI:0 AI:0 I've not used an LLM for any part of this PR, this includes any related work like research.

@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 Nov 24, 2026
@scrabsha

Copy link
Copy Markdown
Contributor Author

@bors try @rust-timer queue priority=-1

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

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Nov 24, 2026
…try>

[EXPERIMENT] perf: remove cache in `TypeRelating`
@rust-bors

rust-bors Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: c9caef8 (c9caef8513c3be94a05fa2b38c1d3dbf4a362e48)
Base parent: 058c701 (058c701055c4b6f60f622d616afc0349911c38c3)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown

Finished benchmarking commit (c9caef8): comparison URL.

Overall result: ✅ improvements - no action needed

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.

@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
Improvements ✅
(primary)
-0.2% [-0.2%, -0.1%] 26
Improvements ✅
(secondary)
-0.3% [-0.5%, -0.2%] 15
All ❌✅ (primary) -0.2% [-0.2%, -0.1%] 26

Max RSS (memory usage)

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

Cycles

Results (primary 2.0%, secondary -2.2%)

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

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

Binary size

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

Bootstrap: 462.461s -> 461.928s (-0.12%)
Artifact size: 405.65 MiB -> 405.67 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 25, 2026
@scrabsha
scrabsha marked this pull request as ready for review November 25, 2026 09:27
@rustbot

rustbot commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

changes to the core type system

cc @lcnr

@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 Nov 25, 2026
@scrabsha scrabsha changed the title [EXPERIMENT] perf: remove cache in TypeRelating perf: remove cache in TypeRelating Nov 25, 2026
@nnethercote

Copy link
Copy Markdown
Contributor

Looks good. Can you check the PR that originally added it to see if there are any non-obvious reasons for keeping it around?

@scrabsha

Copy link
Copy Markdown
Contributor Author

so:

this cache was introduced in #130821. the tests added in this PR (coherence-alias-hang-with-region.rs, coherence-alias-hang.rs, nalgebra-hang) don't hang after removing this cache. i think we're good! i'll update the PR description.

@nnethercote

Copy link
Copy Markdown
Contributor

@bors r+

@rust-bors

rust-bors Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 271018a 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-review Status: Awaiting review from the assignee but also interested parties. labels Nov 25, 2026
@lcnr

lcnr commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

The cache should was added for the new solver, which has since been split into SolverRelating, so unless crates started to crop up which newly depend on this cache in the old solver as well, this removal doesn't matter.

SolverRelating still has a cache and removing that one should result in hangs I expect

@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors p=6 scheduling

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

rust-bors Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: nnethercote
Duration: 2h 54m 8s
Pushing 42e0b13 to main...

@rust-bors
rust-bors Bot merged commit 42e0b13 into rust-lang:main Nov 25, 2026
16 checks passed
@rustbot rustbot added this to the 1.102.0 milestone Nov 25, 2026
@github-actions

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 bc9132d (parent) -> 42e0b13 (this PR)

Test differences

Show 3 test diffs

3 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 42e0b13fb7310a12a827f6a28891c11d2e10923a --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-x86_64-gnu-miri: 45m 19s -> 1h 26m (+91.5%)
  2. test-i686-gnu-nopt-2: 1h 21m -> 2h 22m (+74.4%)
  3. test-x86_64-gnu-llvm-22-1: 47m 26s -> 1h 21m (+71.7%)
  4. test-x86_64-gnu-debug: 1h 23m -> 2h 12m (+58.0%)
  5. dist-i686-msvc: 31m 56s -> 49m 44s (+55.7%)
  6. test-x86_64-msvc-2: 1h 41m -> 2h 35m (+53.2%)
  7. dist-x86_64-llvm-mingw: 1h 22m -> 2h 5m (+52.9%)
  8. test-x86_64-gnu: 1h 42m -> 2h 36m (+51.9%)
  9. dist-powerpc-linux: 1h 2m -> 1h 34m (+49.7%)
  10. test-x86_64-gnu-distcheck: 1h 44m -> 2h 33m (+47.2%)
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 (42e0b13): 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
Regressions ❌
(secondary)
0.2% [0.1%, 0.5%] 10
Improvements ✅
(primary)
-0.2% [-0.2%, -0.1%] 13
Improvements ✅
(secondary)
-0.3% [-0.4%, -0.2%] 12
All ❌✅ (primary) -0.2% [-0.2%, -0.1%] 13

Max RSS (memory usage)

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

Cycles

Results (primary 3.1%, secondary -2.5%)

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

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

Binary size

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

Bootstrap: 462.454s -> 459.97s (-0.54%)
Artifact size: 405.60 MiB -> 405.61 MiB (0.00%)

@rustbot rustbot added the perf-regression Performance regression. label Nov 25, 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. perf-regression Performance regression. 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