Skip to content

Inline some hot new-solver functions - #160892

Open
nnethercote wants to merge 1 commit into
rust-lang:mainfrom
nnethercote:new-solver-inlining
Open

Inline some hot new-solver functions#160892
nnethercote wants to merge 1 commit into
rust-lang:mainfrom
nnethercote:new-solver-inlining

Conversation

@nnethercote

@nnethercote nnethercote commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

View all comments

rerunning_stalled_goal_may_make_progress is split into always-inline and never-inline variants, because it's biggish and has multiple call sites but only one is hot. The other are easy, being either very small or having a single call site.

r? @jdonszelmann

@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 Aug 11, 2026
@nnethercote

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

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 11, 2026
@rust-bors

rust-bors Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: bdde1fb (bdde1fb32f7450db6fd5d778d69a117c761459ed)
Base parent: 0e72e32 (0e72e3266cdd2fe5a658aff454a778a88e5220a3)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (bdde1fb): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

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

Max RSS (memory usage)

Results (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)
- - 0
Regressions ❌
(secondary)
0.5% [0.5%, 0.5%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.6% [-0.8%, -0.4%] 6
All ❌✅ (primary) - - 0

Cycles

Results (secondary -0.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)
0.7% [0.5%, 1.0%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.7% [-1.5%, -0.4%] 12
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 454.011s -> 454.672s (0.15%)
Artifact size: 398.43 MiB -> 398.47 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 11, 2026
@nnethercote

Copy link
Copy Markdown
Contributor Author

Interesting... no perf effect on CI, but I get big effects locally:

image

Presumably this is because CI has PGO and already inlines these functions based on profiling data.

I think it's worth merging this nonetheless, for two reasons:

  • Not every platform has PGO, so the non-PGO platforms will benefit from this.
  • People profiling locally won't be misled.

@nnethercote
nnethercote marked this pull request as ready for review August 11, 2026 07:55
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 11, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Aug 11, 2026
@rustbot

rustbot commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

r? @fee1-dead

rustbot has assigned @fee1-dead.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 75 candidates
  • Random selection from 17 candidates

@rustbot rustbot assigned jdonszelmann and unassigned fee1-dead Aug 11, 2026
@rustbot

rustbot commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

jdonszelmann is currently at their maximum review capacity.
They may take a while to respond.

@rust-bors

This comment has been minimized.

@rustbot

This comment has been minimized.

@nnethercote

Copy link
Copy Markdown
Contributor Author

I rebased over #158436 and somehow things got even better locally:

image

@nnethercote

Copy link
Copy Markdown
Contributor Author

Let's do another perf run just to check it's still a no-op with PGO enabled.

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

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 12, 2026
@rust-bors

rust-bors Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 326d826 (326d826e4be272600a38d4309892f4631e3d5c6b)
Base parent: 3d6c19b (3d6c19bb9ab4798ecfb2ee943df01a811720fc27)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (326d826): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

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

Max RSS (memory usage)

Results (primary -3.0%, secondary -2.4%)

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

mean range count
Regressions ❌
(primary)
2.8% [2.8%, 2.8%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-5.8% [-8.0%, -3.7%] 2
Improvements ✅
(secondary)
-2.4% [-11.6%, -0.4%] 6
All ❌✅ (primary) -3.0% [-8.0%, 2.8%] 3

Cycles

Results (secondary 0.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)
0.7% [0.4%, 1.1%] 14
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.7% [-1.1%, -0.5%] 8
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 455.92s -> 456.054s (0.03%)
Artifact size: 396.47 MiB -> 396.34 MiB (-0.03%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 12, 2026
@nnethercote

Copy link
Copy Markdown
Contributor Author

Still neutral on CI, still worth landing IMO:

  • Not every platform has PGO, so the non-PGO platforms will benefit from this.
  • People profiling locally won't be misled.

@rust-bors

This comment has been minimized.

`rerunning_stalled_goal_may_make_progress` is split into always-inline
and never-inline variants, because it's biggish and has multiple call
sites but only one is hot. The other are easy, being either very small
or having a single call site.
@rustbot

rustbot commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

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.

@nnethercote

Copy link
Copy Markdown
Contributor Author

I rebased again. This is surprisingly conflict-prone for such a small PR. @jdonszelmann, if/when you get a chance... :)

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

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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.

5 participants