Skip to content

Merge several HIR-level queries into one - #155678

Merged
rust-bors[bot] merged 8 commits into
rust-lang:mainfrom
aerooneqq:single-owners-query-exp
May 27, 2026
Merged

Merge several HIR-level queries into one#155678
rust-bors[bot] merged 8 commits into
rust-lang:mainfrom
aerooneqq:single-owners-query-exp

Conversation

@aerooneqq

@aerooneqqaerooneqq commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

View all comments

Now four queries (local_def_id_to_hir_id, opt_hir_owner_nodes, opt_ast_lowering_delayed_lints, in_scope_traits_map) were replaced with regular methods which acts like getters.
An hir_owner query was added that returns a ProjectedMaybeOwner that contains all those fields. hir_attr_map remains a separate query as adding attributes to ProjectedMaybeOwner led to perf regressions.
There is a similar issue with in_scopes_trait_map, but according to the comments from rust-lang/rustc-perf#2436 it is a rare case.
Most of the changes in incremental tests are renames from opt_hir_owner_nodes -> hir_owner, but there are few cases when new dirty queries were added.

r? @petrochenkov
r? @oli-obk

@rustbotrustbot 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 Apr 23, 2026
@rust-log-analyzer

This comment has been minimized.

@aerooneqq
aerooneqqforce-pushed the single-owners-query-exp branch from 7b9e758 to 67a6a79CompareApril 23, 2026 09:24
@petrochenkov

Copy link
Copy Markdown
Contributor

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbotrustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 23, 2026
@rust-bors

This comment has been minimized.

rust-borsBot pushed a commit that referenced this pull request Apr 23, 2026
@rust-bors

rust-borsBot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: a7e17f9 (a7e17f9dcdebc727f983dd75b86950023250e23a, parent: 92c7010294007f9bb819f0ddd9d9e9b5ccd5714a)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (a7e17f9): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

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.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=never
@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.

meanrangecount
Regressions ❌
(primary)
42.5%[0.3%, 107.3%]7
Regressions ❌
(secondary)
27.3%[0.0%, 106.5%]10
Improvements ✅
(primary)
-1.1%[-2.6%, -0.2%]111
Improvements ✅
(secondary)
-1.6%[-5.3%, -0.2%]68
All ❌✅ (primary)1.4%[-2.6%, 107.3%]118

Max RSS (memory usage)

Results (primary 1.5%, secondary -0.4%)

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

meanrangecount
Regressions ❌
(primary)
17.4%[9.5%, 28.4%]6
Regressions ❌
(secondary)
4.6%[2.3%, 7.3%]10
Improvements ✅
(primary)
-1.2%[-2.2%, -0.6%]36
Improvements ✅
(secondary)
-4.1%[-6.8%, -1.8%]14
All ❌✅ (primary)1.5%[-2.2%, 28.4%]42

Cycles

Results (primary 40.1%, secondary 5.3%)

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

meanrangecount
Regressions ❌
(primary)
61.3%[9.7%, 117.9%]6
Regressions ❌
(secondary)
19.9%[1.8%, 63.2%]10
Improvements ✅
(primary)
-2.3%[-2.6%, -2.1%]3
Improvements ✅
(secondary)
-3.8%[-5.3%, -1.5%]16
All ❌✅ (primary)40.1%[-2.6%, 117.9%]9

Binary size

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

Bootstrap: 500.795s -> 487.693s (-2.62%)
Artifact size: 394.31 MiB -> 394.27 MiB (-0.01%)

@rustbotrustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Apr 23, 2026
@aerooneqq
aerooneqqforce-pushed the single-owners-query-exp branch 2 times, most recently from 69beb66 to 464a7a0CompareApril 24, 2026 11:17
@petrochenkov

Copy link
Copy Markdown
Contributor

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbotrustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 24, 2026
rust-borsBot pushed a commit that referenced this pull request Apr 24, 2026
@rust-bors

rust-borsBot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 7769c1a (7769c1a185b3989b2a2bf22894bf03f2b0505c4c, parent: cf79d034aa3d8f396d407aafce6f1ccd818e710e)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (7769c1a): 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
@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.

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
0.2%[0.0%, 0.6%]4
Improvements ✅
(primary)
-0.8%[-1.7%, -0.2%]99
Improvements ✅
(secondary)
-1.0%[-2.8%, -0.0%]56
All ❌✅ (primary)-0.8%[-1.7%, -0.2%]99

Max RSS (memory usage)

Results (primary -0.0%, secondary 2.0%)

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

meanrangecount
Regressions ❌
(primary)
2.2%[1.0%, 3.5%]2
Regressions ❌
(secondary)
3.9%[2.3%, 7.4%]6
Improvements ✅
(primary)
-0.8%[-0.9%, -0.6%]6
Improvements ✅
(secondary)
-2.0%[-2.3%, -1.5%]3
All ❌✅ (primary)-0.0%[-0.9%, 3.5%]8

Cycles

Results (primary -2.9%, secondary -0.7%)

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

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
3.5%[1.3%, 6.8%]4
Improvements ✅
(primary)
-2.9%[-2.9%, -2.9%]1
Improvements ✅
(secondary)
-2.8%[-3.5%, -1.3%]8
All ❌✅ (primary)-2.9%[-2.9%, -2.9%]1

Binary size

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

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

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
--0
Improvements ✅
(primary)
-0.0%[-0.0%, -0.0%]11
Improvements ✅
(secondary)
-0.1%[-0.1%, -0.0%]4
All ❌✅ (primary)-0.0%[-0.0%, -0.0%]11

Bootstrap: 493.065s -> 491.562s (-0.30%)
Artifact size: 394.27 MiB -> 394.23 MiB (-0.01%)

@rustbotrustbot removed perf-regression Performance regression. S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Apr 24, 2026
@rust-bors

This comment has been minimized.

@aerooneqq

Copy link
Copy Markdown
ContributorAuthor

@rustbot ready

@rustbotrustbot 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 May 18, 2026
Comment threadcompiler/rustc_middle/src/dep_graph/graph.rs Outdated
Comment threadcompiler/rustc_middle/src/hir/mod.rs Outdated

@oli-obkoli-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.

@rust-bors

rust-borsBot commented May 27, 2026

Copy link
Copy Markdown
Contributor

📌 Commit fc6b395 has been approved by oli-obk

It is now in the queue for this repository.

@rust-borsrust-borsBot 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 May 27, 2026
@rust-bors

This comment has been minimized.

@rust-borsrust-borsBot 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 May 27, 2026
@rust-bors

rust-borsBot commented May 27, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: oli-obk
Duration: 4h 15m 14s
Pushing 77a4fb6 to main...

@rust-bors
rust-borsBot merged commit 77a4fb6 into rust-lang:mainMay 27, 2026
12 checks passed
@rustbotrustbot added this to the 1.98.0 milestone May 27, 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 ddc1a64 (parent) -> 77a4fb6 (this PR)

Test differences

Show 178 test diffs

178 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 77a4fb62f70c6ea05e1820216d903938e331d42b --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. dist-powerpc-linux: 1h -> 2h 4m (+106.8%)
  2. dist-arm-linux-musl: 1h 37m -> 3h 3m (+86.9%)
  3. dist-x86_64-apple: 2h 2m -> 3h 35m (+76.4%)
  4. dist-x86_64-illumos: 1h 46m -> 3h 1m (+70.2%)
  5. dist-android: 27m 49s -> 46m 42s (+67.9%)
  6. dist-sparcv9-solaris: 1h 35m -> 2h 38m (+66.2%)
  7. dist-x86_64-solaris: 1h 40m -> 2h 41m (+60.8%)
  8. dist-arm-linux-gnueabi: 1h 23m -> 2h 6m (+50.9%)
  9. dist-ohos-x86_64: 1h 21m -> 2h (+48.1%)
  10. dist-ohos-armv7: 1h 15m -> 1h 49m (+45.0%)
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
Collaborator

Finished benchmarking commit (77a4fb6): 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.

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
0.4%[0.0%, 1.1%]11
Improvements ✅
(primary)
-0.7%[-1.7%, -0.1%]109
Improvements ✅
(secondary)
-0.9%[-2.8%, -0.1%]62
All ❌✅ (primary)-0.7%[-1.7%, -0.1%]109

Max RSS (memory usage)

Results (primary -0.3%, secondary -2.2%)

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

meanrangecount
Regressions ❌
(primary)
0.9%[0.9%, 0.9%]1
Regressions ❌
(secondary)
0.7%[0.7%, 0.7%]2
Improvements ✅
(primary)
-0.7%[-0.8%, -0.5%]3
Improvements ✅
(secondary)
-3.6%[-6.2%, -2.1%]4
All ❌✅ (primary)-0.3%[-0.8%, 0.9%]4

Cycles

Results (primary -2.3%, secondary -2.2%)

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

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
3.5%[3.5%, 3.5%]1
Improvements ✅
(primary)
-2.3%[-2.6%, -2.0%]3
Improvements ✅
(secondary)
-3.1%[-5.3%, -2.1%]6
All ❌✅ (primary)-2.3%[-2.6%, -2.0%]3

Binary size

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

Bootstrap: 510.991s -> 511.088s (0.02%)
Artifact size: 400.76 MiB -> 400.69 MiB (-0.02%)

@rustbotrustbot added the perf-regression Performance regression. label May 27, 2026
pullBot pushed a commit to xtqqczze/rust-lang-miri that referenced this pull request May 28, 2026
Merge several HIR-level queries into one
Now four queries (`local_def_id_to_hir_id`, `opt_hir_owner_nodes`, `opt_ast_lowering_delayed_lints`, `in_scope_traits_map`) were replaced with regular methods which acts like getters. An `hir_owner` query was added that returns a `ProjectedMaybeOwner` that contains all those fields. `hir_attr_map` remains a separate query as adding attributes to `ProjectedMaybeOwner` led to [perf regressions](rust-lang/rust#155678 (comment)). There is a similar issue with `in_scopes_trait_map`, but according to the comments from rust-lang/rustc-perf#2436 it is a rare case.
Most of the changes in incremental tests are renames from `opt_hir_owner_nodes` -> `hir_owner`, but there are few cases when new dirty queries were added.
r? @petrochenkov
r? @oli-obk
github-actionsBot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request May 30, 2026
Merge several HIR-level queries into one
Now four queries (`local_def_id_to_hir_id`, `opt_hir_owner_nodes`, `opt_ast_lowering_delayed_lints`, `in_scope_traits_map`) were replaced with regular methods which acts like getters. An `hir_owner` query was added that returns a `ProjectedMaybeOwner` that contains all those fields. `hir_attr_map` remains a separate query as adding attributes to `ProjectedMaybeOwner` led to [perf regressions](rust-lang/rust#155678 (comment)). There is a similar issue with `in_scopes_trait_map`, but according to the comments from rust-lang/rustc-perf#2436 it is a rare case.
Most of the changes in incremental tests are renames from `opt_hir_owner_nodes` -> `hir_owner`, but there are few cases when new dirty queries were added.
r? @petrochenkov
r? @oli-obk
@Kobzol

Copy link
Copy Markdown
Member

Wins greatly outweigh the regressions.

@rustbot label: +perf-regression-triaged

@rustbotrustbot added the perf-regression-triaged The performance regression has been triaged. label Jun 1, 2026
pullBot pushed a commit to asukaminato0721/rust-analyzer that referenced this pull request Jun 7, 2026
Merge several HIR-level queries into one
Now four queries (`local_def_id_to_hir_id`, `opt_hir_owner_nodes`, `opt_ast_lowering_delayed_lints`, `in_scope_traits_map`) were replaced with regular methods which acts like getters. An `hir_owner` query was added that returns a `ProjectedMaybeOwner` that contains all those fields. `hir_attr_map` remains a separate query as adding attributes to `ProjectedMaybeOwner` led to [perf regressions](rust-lang/rust#155678 (comment)). There is a similar issue with `in_scopes_trait_map`, but according to the comments from rust-lang/rustc-perf#2436 it is a rare case.
Most of the changes in incremental tests are renames from `opt_hir_owner_nodes` -> `hir_owner`, but there are few cases when new dirty queries were added.
r? @petrochenkov
r? @oli-obk
github-actionsBot pushed a commit to rust-lang/stdarch that referenced this pull request Jun 8, 2026
Merge several HIR-level queries into one
Now four queries (`local_def_id_to_hir_id`, `opt_hir_owner_nodes`, `opt_ast_lowering_delayed_lints`, `in_scope_traits_map`) were replaced with regular methods which acts like getters. An `hir_owner` query was added that returns a `ProjectedMaybeOwner` that contains all those fields. `hir_attr_map` remains a separate query as adding attributes to `ProjectedMaybeOwner` led to [perf regressions](rust-lang/rust#155678 (comment)). There is a similar issue with `in_scopes_trait_map`, but according to the comments from rust-lang/rustc-perf#2436 it is a rare case.
Most of the changes in incremental tests are renames from `opt_hir_owner_nodes` -> `hir_owner`, but there are few cases when new dirty queries were added.
r? @petrochenkov
r? @oli-obk
ghaaj pushed a commit to ghaaj/polygrammar that referenced this pull request Aug 7, 2026
Merge several HIR-level queries into one
Now four queries (`local_def_id_to_hir_id`, `opt_hir_owner_nodes`, `opt_ast_lowering_delayed_lints`, `in_scope_traits_map`) were replaced with regular methods which acts like getters. An `hir_owner` query was added that returns a `ProjectedMaybeOwner` that contains all those fields. `hir_attr_map` remains a separate query as adding attributes to `ProjectedMaybeOwner` led to [perf regressions](rust-lang/rust#155678 (comment)). There is a similar issue with `in_scopes_trait_map`, but according to the comments from rust-lang/rustc-perf#2436 it is a rare case.
Most of the changes in incremental tests are renames from `opt_hir_owner_nodes` -> `hir_owner`, but there are few cases when new dirty queries were added.
r? @petrochenkov
r? @oli-obk
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.perf-regressionPerformance regression.perf-regression-triagedThe performance regression has been triaged.T-compilerRelevant 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.

8 participants

@aerooneqq@rust-log-analyzer@petrochenkov@rust-timer@rustbot@Kobzol@oli-obk@cjgillot