Skip to content

Get rid of QueryVTable::call_query_method_fn#153387

Open
Zalathar wants to merge 1 commit intorust-lang:mainfrom
Zalathar:call-query
Open

Get rid of QueryVTable::call_query_method_fn#153387
Zalathar wants to merge 1 commit intorust-lang:mainfrom
Zalathar:call-query

Conversation

@Zalathar
Copy link
Member

@Zalathar Zalathar commented Mar 4, 2026

Calling the query method to promote a value is equivalent to doing a cache lookup and then calling execute_query_fn, so we can just do that manually instead.

There are two “functional” differences here: If a cache hit occurs, we don't record the hit for self-profiling, and we don't register a read of the dep node. In the context of promotion, which touches all eligible cache entries just before writing the memory-cached values to disk, those two steps should be unnecessary overhead anyway.

r? nnethercote (or compiler)

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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 Mar 4, 2026
@Zalathar
Copy link
Member Author

Zalathar commented Mar 4, 2026

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Mar 4, 2026
Get rid of `QueryVTable::call_query_method_fn`
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 4, 2026
@Zalathar Zalathar mentioned this pull request Mar 4, 2026
@nnethercote
Copy link
Contributor

Seems fine, good to get rid of this fn. r=me once perf results come back ok.

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 4, 2026

☀️ Try build successful (CI)
Build commit: 5bc0460 (5bc04606b33438d872679e82b473662e1bdaefcf, parent: d933cf483edf1605142ac6899ff32536c0ad8b22)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5bc0460): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in 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
Improvements ✅
(primary)
-0.3% [-0.3%, -0.1%] 9
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.1%] 6
All ❌✅ (primary) -0.3% [-0.3%, -0.1%] 9

Max RSS (memory usage)

Results (secondary -5.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
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-5.2% [-5.2%, -5.2%] 1
All ❌✅ (primary) - - 0

Cycles

Results (primary 2.4%, 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)
2.4% [2.3%, 2.4%] 2
Regressions ❌
(secondary)
5.3% [3.0%, 7.6%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-17.2% [-17.2%, -17.2%] 1
All ❌✅ (primary) 2.4% [2.3%, 2.4%] 2

Binary size

Results (primary 0.1%, 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.1% [0.0%, 0.1%] 23
Regressions ❌
(secondary)
0.1% [0.0%, 0.1%] 54
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.0%, 0.1%] 23

Bootstrap: 481.183s -> 478.983s (-0.46%)
Artifact size: 394.90 MiB -> 394.84 MiB (-0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 4, 2026
@Zalathar
Copy link
Member Author

Zalathar commented Mar 4, 2026

@bors r=nnethercote

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 4, 2026

📌 Commit bab6f12 has been approved by nnethercote

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. 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. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 4, 2026
@rust-bors

This comment has been minimized.

Calling the query method is equivalent to doing a cache lookup and then calling
`execute_query_fn`, so we can just do that manually instead.
@rustbot
Copy link
Collaborator

rustbot commented Mar 5, 2026

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.

@Zalathar
Copy link
Member Author

Zalathar commented Mar 5, 2026

Rebased.

@bors r=nnethercote

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 5, 2026

📌 Commit 9012d4e has been approved by nnethercote

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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