Skip to content

Replace query erase_and_anonymize_regions_ty with a helper function#153856

Closed
Zalathar wants to merge 1 commit intorust-lang:mainfrom
Zalathar:erase-and
Closed

Replace query erase_and_anonymize_regions_ty with a helper function#153856
Zalathar wants to merge 1 commit intorust-lang:mainfrom
Zalathar:erase-and

Conversation

@Zalathar
Copy link
Member

The comments for this query suggest that it shouldn't call any other queries, and is a pure function of its input that only uses the query system for caching its return value.

If that's accurate, then we should be able to replace the query with a plain function that does its own caching.

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

@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 14, 2026
Replace query `erase_and_anonymize_regions_ty` with a helper function
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 14, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 14, 2026

☔ The latest upstream changes (presumably #153846) made this pull request unmergeable. Please resolve the merge conflicts.

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 14, 2026

☀️ Try build successful (CI)
Build commit: bc5cc60 (bc5cc606b9d8c5b37deaf2f3fbdb3d382521390d, parent: a0e206b5665d7c075cdc0ca5f3637a697e8ff55a)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (bc5cc60): comparison URL.

Overall result: ❌✅ regressions and 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.0% [0.0%, 0.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -2.4%, secondary 0.5%)

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)
1.0% [0.9%, 1.1%] 2
Improvements ✅
(primary)
-2.4% [-2.4%, -2.4%] 1
Improvements ✅
(secondary)
-0.7% [-0.7%, -0.7%] 1
All ❌✅ (primary) -2.4% [-2.4%, -2.4%] 1

Cycles

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

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)
-2.2% [-2.2%, -2.2%] 1
Improvements ✅
(secondary)
-4.6% [-4.6%, -4.6%] 1
All ❌✅ (primary) -2.2% [-2.2%, -2.2%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 481.291s -> 480.666s (-0.13%)
Artifact size: 394.91 MiB -> 394.79 MiB (-0.03%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 14, 2026
@Zoxc
Copy link
Contributor

Zoxc commented Mar 14, 2026

Same as #139240

@Zalathar
Copy link
Member Author

Heh, maybe I should put a note in the source warning that this has been tried multiple times.

And yeah, if this doesn’t bring a meaningful perf improvement or a meaningful simplification, then it’s hard to justify doing something custom instead of just using the query machinery.

@Zalathar Zalathar closed this Mar 14, 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 Mar 14, 2026
@Zalathar Zalathar deleted the erase-and branch March 14, 2026 13:48
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) 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