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
Copy link
Copy Markdown
Contributor

@aerooneqq aerooneqq commented Apr 23, 2026

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

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

This comment has been minimized.

@aerooneqq aerooneqq force-pushed the single-owners-query-exp branch from 7b9e758 to 67a6a79 Compare April 23, 2026 09:24
@petrochenkov
Copy link
Copy Markdown
Contributor

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

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Apr 23, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 23, 2026

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

mean range count
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.

mean range count
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.

mean range count
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%)

@rustbot rustbot 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 aerooneqq force-pushed the single-owners-query-exp branch 2 times, most recently from 69beb66 to 464a7a0 Compare April 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.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 24, 2026
rust-bors Bot pushed a commit that referenced this pull request Apr 24, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 24, 2026

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

mean range count
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.

mean range count
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.

mean range count
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.

mean range count
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%)

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

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 15, 2026

☀️ Try build successful (CI)
Build commit: 8859956 (885995683a54fec9f53bdca583ee62263c6fb7d3, parent: 88ba7fbe0a6eda36e0adbfd0482856f3784031b9)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

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

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.1% [0.0%, 0.1%] 2
Improvements ✅
(primary)
-0.7% [-1.6%, -0.2%] 117
Improvements ✅
(secondary)
-0.9% [-2.9%, -0.0%] 66
All ❌✅ (primary) -0.7% [-1.6%, -0.2%] 117

Max RSS (memory usage)

Results (primary -0.8%, secondary 1.0%)

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

mean range count
Regressions ❌
(primary)
0.8% [0.8%, 0.8%] 1
Regressions ❌
(secondary)
4.4% [1.3%, 9.8%] 6
Improvements ✅
(primary)
-1.0% [-1.2%, -0.7%] 8
Improvements ✅
(secondary)
-2.3% [-2.9%, -1.4%] 6
All ❌✅ (primary) -0.8% [-1.2%, 0.8%] 9

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)
4.2% [2.9%, 5.5%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.8% [-2.9%, -2.7%] 3
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 510.626s -> 510.588s (-0.01%)
Artifact size: 398.07 MiB -> 398.12 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 15, 2026
Comment thread compiler/rustc_hir/src/hir.rs Outdated
Comment thread compiler/rustc_middle/src/queries.rs Outdated
Comment thread compiler/rustc_middle/src/queries.rs Outdated
Comment thread compiler/rustc_middle/src/queries.rs
@aerooneqq
Copy link
Copy Markdown
Contributor Author

@rustbot ready

@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 May 18, 2026
Comment thread compiler/rustc_middle/src/dep_graph/graph.rs Outdated
Comment thread compiler/rustc_middle/src/hir/mod.rs Outdated
Copy link
Copy Markdown
Contributor

@oli-obk oli-obk left a comment

Choose a reason for hiding this comment

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

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 27, 2026

📌 Commit fc6b395 has been approved by oli-obk

It is now in the queue for this repository.

@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 May 27, 2026
@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 May 27, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 27, 2026

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

@rust-bors rust-bors Bot merged commit 77a4fb6 into rust-lang:main May 27, 2026
12 checks passed
@rustbot rustbot 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.

mean range count
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.

mean range count
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.

mean range count
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%)

@rustbot rustbot added the perf-regression Performance regression. label May 27, 2026
pull Bot 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
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. perf-regression Performance regression. 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.

7 participants