Skip to content

optimize empty NestedGoals::extend_from_child - #163610

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
lcnr:nested-goals-opt
Oct 5, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
lcnr:nested-goals-opt

Conversation

@lcnr

@lcnr lcnr commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

we sometimes get incredibly big nested_goals from large and involved cycles. When propagating them outwards, we currently manually build a HashMap by accessing an entry for every nested goal of the child. This is unnecessary.

This does not help with the max-rss regression in #161660, but should help with perf in such cases.

r? types

@rustbot rustbot added 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. labels Oct 1, 2026
@lcnr

lcnr commented Oct 1, 2026

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

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 1, 2026
optimize empty `NestedGoals::extend_from_child`
@rust-bors

rust-bors Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: c16c567 (c16c567479a3763d7fa29a43c887b7b686b938c3)
Base parent: 837b18a (837b18aae097503892d7aab6c7ddce332a991a21)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (c16c567): comparison URL.

Overall result: ❌✅ regressions and improvements - 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

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

Max RSS (memory usage)

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

Cycles

Results (secondary -0.0%)

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

Binary size

Results (primary -0.0%, secondary -0.0%)

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.0% [-0.1%, -0.0%] 39
Improvements ✅
(secondary)
-0.0% [-0.1%, -0.0%] 9
All ❌✅ (primary) -0.0% [-0.1%, -0.0%] 39

Bootstrap: 490.365s -> 489.428s (-0.19%)
Artifact size: 406.38 MiB -> 406.44 MiB (0.02%)

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

@oli-obk oli-obk left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread compiler/rustc_type_ir/src/search_graph/mod.rs Outdated
Comment thread compiler/rustc_type_ir/src/search_graph/mod.rs Outdated
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 5, 2026
@rustbot

rustbot commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@lcnr
lcnr force-pushed the nested-goals-opt branch from 769694e to bc219a1 Compare October 5, 2026 07:21
@rustbot

rustbot commented Oct 5, 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.

@lcnr
lcnr force-pushed the nested-goals-opt branch from bc219a1 to 9c4bef5 Compare October 5, 2026 07:23
@lcnr

lcnr commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

@bors r=oli-obk rollup=iffy (small perf impact)

@rust-bors

rust-bors Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 9c4bef5 has been tentatively approved by oli-obk

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 5, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 5, 2026
…uwer

Rollup of 4 pull requests

Successful merges:

 - #163790 (miri subtree update)
 - #163610 (optimize empty `NestedGoals::extend_from_child`)
 - #163697 (cg_llvm: Use `LLVMGlobalAddMetadata` from LLVM-C)
 - #163750 (lower spans of error const args and test binder bounds)
@rust-bors
rust-bors Bot merged commit 94c2bd2 into rust-lang:main Oct 5, 2026
14 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Oct 5, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 5, 2026
Rollup merge of #163610 - lcnr:nested-goals-opt, r=oli-obk

optimize empty `NestedGoals::extend_from_child`

we sometimes get incredibly big `nested_goals` from large and involved cycles. When propagating them outwards, we currently manually build a `HashMap` by accessing an entry for every nested goal of the child. This is unnecessary.

This does not help with the max-rss regression in #161660, but should help with perf in such cases.

r? types
@lcnr
lcnr deleted the nested-goals-opt branch October 5, 2026 20:59
programskillforverification pushed a commit to programskillforverification/miri that referenced this pull request Oct 9, 2026
…uwer

Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#163790 (miri subtree update)
 - rust-lang/rust#163610 (optimize empty `NestedGoals::extend_from_child`)
 - rust-lang/rust#163697 (cg_llvm: Use `LLVMGlobalAddMetadata` from LLVM-C)
 - rust-lang/rust#163750 (lower spans of error const args and test binder bounds)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

4 participants