Skip to content

perf: remove cache in DeepResolverIgnoringRegions - #166384

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

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

Conversation

@scrabsha

@scrabsha scrabsha commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

this was initially added in #130821 but apparently is no longer necessary. removing this cache reduces IC by 0.12% to 0.48% across all the primary benchmarks and improves cycles/wall time on next-solver-stress and typenum.

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

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

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Nov 23, 2026
…ngregions, r=<try>

[EXPERIMENT] remove cache in `DeepResolverIgnoringRegions`
@rust-bors

rust-bors Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 35cbf19 (35cbf195a28b4d5a3dbf23bce4ea53e218e683bd)
Base parent: 0259d5e (0259d5e9a81c6af08e40f8c204f2c0c41dca1647)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown

Finished benchmarking commit (35cbf19): 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.3% [-0.5%, -0.1%] 58
Improvements ✅
(secondary)
-0.9% [-3.2%, -0.2%] 85
All ❌✅ (primary) -0.3% [-0.5%, -0.1%] 58

Max RSS (memory usage)

Results (secondary -2.8%)

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

Cycles

Results (secondary -1.9%)

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.1% [0.6%, 5.2%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.2% [-4.3%, -0.9%] 10
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 460.582s -> 460.964s (0.08%)
Artifact size: 405.69 MiB -> 405.58 MiB (-0.03%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 23, 2026
@scrabsha

scrabsha commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor Author

i was measuring some cycle count regressions locally, but apparently they don't show up on CI, cool!

i'm going to:

  • polish this PR
  • add on top of it another commit that removes another cache that seemed promising locally. we'll see how it goes.

@nnethercote

Copy link
Copy Markdown
Contributor

It looks to me like there is a clear cycles/wall-time signal on next-solver-stress and typenum. And instruction counts look great.

add on top of it another commit that removes another cache that seemed promising locally. we'll see how it goes.

Maybe do that in a separate PR? If it's a different type folder, it's probably best to keep the changes separate to make the results tracking clearer.

@scrabsha
scrabsha marked this pull request as ready for review November 24, 2026 09:50
@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 24, 2026
@scrabsha scrabsha changed the title [EXPERIMENT] remove cache in DeepResolverIgnoringRegions perf: remove cache in DeepResolverIgnoringRegions Nov 24, 2026
@scrabsha
scrabsha force-pushed the perf/remove-cache-deepresolverignoringregions branch from 69a413d to 1b02873 Compare November 24, 2026 09:54
@scrabsha

Copy link
Copy Markdown
Contributor Author

the force push contains a polished version of the initial commit. i do not expect the performances to change (i literally just inlined a variable reference that was defined at the previous line).

@nnethercote

Copy link
Copy Markdown
Contributor

@bors r+

@rust-bors

rust-bors Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 1b02873 has been tentatively approved by nnethercote

It will be put into the queue for this repository once PR CI succeeds.

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

Copy link
Copy Markdown
Contributor

I don't exactly understand why was the cache added in the first place. It seems like this was a regression since the begining in the original PR. Did you figure it out?

The original PR says that it fixes a hang in nalgebra (related to the new solver, I guess, because the results were red on nalgebra in the old one). Now it seems green on both so I wonder what changed since then.

@scrabsha

scrabsha commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

I don't exactly understand why was the cache added in the first place. It seems like this was a regression since the begining in the original PR. Did you figure it out?

i don't understand either. the original PR was focused on avoiding a hang in nalgebra, so i wouldn't be surprised if avoiding perf regression was never considered.

@nnethercote

Copy link
Copy Markdown
Contributor

The new solver has seen a lot of changes (including optimizations) since #130821, which was over two years ago. Presumably one or more of those changes made this cache unnecessary.

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

rust-bors Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: nnethercote
Duration: 3h 7m 34s
Pushing 4cedc6b to main...

@rust-bors
rust-bors Bot merged commit 4cedc6b into rust-lang:main Nov 24, 2026
15 checks passed
@rustbot rustbot added this to the 1.102.0 milestone Nov 24, 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 cc43a03 (parent) -> 4cedc6b (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 4cedc6bd576618ca90bc479c67e4ba16892a6188 --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-msvc-ext2: -> 1h 15m (+inf%)
  2. test-aarch64-gnu-llvm-22-2: -> 56m 39s (+inf%)
  3. dist-riscv64-linux-musl: -> 1h 33m (+inf%)
  4. test-aarch64-gnu: -> 2h 13m (+inf%)
  5. dist-x86_64-linux: -> 1h 46m (+inf%)
  6. dist-android: -> 26m 57s (+inf%)
  7. dist-powerpc-linux: -> 1h 36m (+inf%)
  8. test-i686-gnu-1: -> 1h 49m (+inf%)
  9. test-i686-gnu-nopt-2: -> 2h 22m (+inf%)
  10. test-x86_64-gnu-tools: -> 1h 9m (+inf%)
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 (4cedc6b): 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.3% [-0.5%, -0.1%] 62
Improvements ✅
(secondary)
-1.0% [-3.3%, -0.2%] 83
All ❌✅ (primary) -0.3% [-0.5%, -0.1%] 62

Max RSS (memory usage)

Results (secondary -3.9%)

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)
-3.9% [-4.3%, -3.6%] 2
All ❌✅ (primary) - - 0

Cycles

Results (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)
- - 0
Regressions ❌
(secondary)
4.1% [2.7%, 5.5%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.2% [-5.7%, -2.1%] 25
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 462.502s -> 461.503s (-0.22%)
Artifact size: 406.51 MiB -> 406.39 MiB (-0.03%)

@scrabsha
scrabsha deleted the perf/remove-cache-deepresolverignoringregions branch November 25, 2026 08:41
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