Skip to content

perf: Do not reevaluate goals on the changes on the very opaques registered by them - #162166

Draft
ShoyuVanilla wants to merge 1 commit into
rust-lang:mainfrom
ShoyuVanilla:my-own-opaques-are-boring
Draft

perf: Do not reevaluate goals on the changes on the very opaques registered by them#162166
ShoyuVanilla wants to merge 1 commit into
rust-lang:mainfrom
ShoyuVanilla:my-own-opaques-are-boring

Conversation

@ShoyuVanilla

@ShoyuVanilla ShoyuVanilla commented Sep 2, 2026

Copy link
Copy Markdown
Member

Originally written by @cynecx in rust-lang/rust-analyzer#23217 (comment)

Currently we track StalledOnOpaques with the number of opaques when we started to evaluate the goal.
This is correct and safe, but it makes the goals normalizes opaques, either by their own or their nested goals, to be evaluated once again b/c the num_opaques_in_storage is changed by themselves.

I think tracking the num_opaques_in_storage from the point we finished to evaluate the goal make sense, because..

  • The only places we directly register opaques is when we evaluate Projection goals for opaques, and they are surely unaffected by skipping reevaluation.
  • For the goals who have the above goals as nested goals are also unaffected, as registering some opaques from some nested goals still makes the other goals to be reevaluated in the fixed-point iteration.

@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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Sep 2, 2026
@ShoyuVanilla ShoyuVanilla changed the title perf: Do not reevaluate goals on the changes on the very opaques regi… perf: Do not reevaluate goals on the changes on the very opaques registered by them Sep 2, 2026
@rust-log-analyzer

This comment has been minimized.

@ShoyuVanilla
ShoyuVanilla force-pushed the my-own-opaques-are-boring branch from 8b0c378 to 370476a Compare September 2, 2026 05:03
@ShoyuVanilla

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

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 2, 2026
perf: Do not reevaluate goals on the changes on the very opaques registered by them
@rust-bors

rust-bors Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: b6ebf68 (b6ebf68a1faeb76a18761a2b1b04e6f5c915b129)
Base parent: edc52f8 (edc52f87c28f328c61685a02c47887a5cec7d767)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (b6ebf68): 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
Improvements ✅
(secondary)
-4.3% [-8.1%, -0.6%] 6
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 1.1%, secondary 1.8%)

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

mean range count
Regressions ❌
(primary)
1.1% [0.9%, 1.4%] 4
Regressions ❌
(secondary)
1.8% [0.7%, 3.3%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.1% [0.9%, 1.4%] 4

Cycles

Results (primary -3.4%, secondary -3.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)
3.9% [3.9%, 3.9%] 1
Improvements ✅
(primary)
-3.4% [-3.4%, -3.4%] 1
Improvements ✅
(secondary)
-4.4% [-7.1%, -2.0%] 13
All ❌✅ (primary) -3.4% [-3.4%, -3.4%] 1

Binary size

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

Bootstrap: 472.928s -> 474.036s (0.23%)
Artifact size: 401.53 MiB -> 400.59 MiB (-0.23%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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. 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.

4 participants