Skip to content

perf: drop the full-crate AST walk in check_unused#157996

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
xmakro:perf/projcache-entry-probe
Jun 28, 2026
Merged

perf: drop the full-crate AST walk in check_unused#157996
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
xmakro:perf/projcache-entry-probe

Conversation

@xmakro

@xmakro xmakro commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@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 Jun 16, 2026
@panstromek

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 Jun 18, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 18, 2026
perf: collapse double hash probe in projection cache fill path
@rust-bors

rust-bors Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 10296d0 (10296d0b17db40699779e54bc47d12b222b21532)
Base parent: 3768ec0 (3768ec06c826ef667b65a7d084610a11baf10776)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (10296d0): comparison URL.

Overall result: ✅ 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
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.2%] 2
All ❌✅ (primary) - - 0

Max RSS (memory usage)

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

Cycles

Results (secondary 3.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)
4.0% [2.2%, 5.3%] 7
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.3% [-2.3%, -2.3%] 1
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 522.822s -> 524.255s (0.27%)
Artifact size: 401.33 MiB -> 401.83 MiB (0.13%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 18, 2026
@xmakro xmakro force-pushed the perf/projcache-entry-probe branch from 786e2c5 to 80844b8 Compare June 20, 2026 20:06
@xmakro xmakro changed the title perf: collapse double hash probe in projection cache fill path perf: drop the full-crate AST walk in check_unused Jun 20, 2026
@workingjubilee

Copy link
Copy Markdown
Member

second verse, same as the first

@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 Jun 20, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 20, 2026
perf: drop the full-crate AST walk in check_unused
@rust-bors

rust-bors Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: e47847f (e47847fd15ffa381d821774521ab42d250b6f712)
Base parent: 8b6558a (8b6558a02b2774acfb25cf15e199467c37ba7490)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (e47847f): 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)
- - 0
Regressions ❌
(secondary)
0.5% [0.4%, 0.6%] 6
Improvements ✅
(primary)
-0.2% [-0.3%, -0.1%] 20
Improvements ✅
(secondary)
-0.3% [-0.4%, -0.2%] 11
All ❌✅ (primary) -0.2% [-0.3%, -0.1%] 20

Max RSS (memory usage)

Results (primary 1.4%, secondary 1.8%)

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

mean range count
Regressions ❌
(primary)
1.4% [0.7%, 2.2%] 3
Regressions ❌
(secondary)
3.2% [2.1%, 4.1%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.3% [-2.3%, -2.3%] 1
All ❌✅ (primary) 1.4% [0.7%, 2.2%] 3

Cycles

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

Binary size

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

Bootstrap: 482.01s -> 480.385s (-0.34%)
Artifact size: 391.28 MiB -> 390.72 MiB (-0.14%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jun 21, 2026
@xmakro

xmakro commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

@nnethercote: could you please check if this perf improvement is significant enough?

@nnethercote

Copy link
Copy Markdown
Contributor

The perf improvements are small but the change is simple so it seems good to me.

@xmakro xmakro marked this pull request as ready for review June 26, 2026 19:11
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 26, 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 Jun 26, 2026
@rustbot

rustbot commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

r? @Kivooeo

rustbot has assigned @Kivooeo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 73 candidates
  • Random selection from 18 candidates

@Kivooeo

Kivooeo commented Jun 28, 2026

Copy link
Copy Markdown
Member

@bors r=nnethercote,Kivooeo rollup

@rust-bors

rust-bors Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 80844b8 has been approved by nnethercote,Kivooeo

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 2. This pull request will be tested once the tree is reopened.

@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 Jun 28, 2026
rust-bors Bot pushed a commit that referenced this pull request Jun 28, 2026
Rollup of 15 pull requests

Successful merges:

 - #158497 (stdarch subtree update)
 - #152225 (Add supertrait item shadowing for type-level path resolution)
 - #158194 (Adds RmetaLinkCache a per-link cache that uses path as the key of dec…)
 - #158466 (rustdoc: show impl Trait<Box<Local>> for Foreign, etc on Local's docs)
 - #158501 (miri subtree update)
 - #153097 (Expand `OptionFlatten`'s iterator methods)
 - #157614 (Move tests drop)
 - #157996 (perf: drop the full-crate AST walk in check_unused)
 - #158163 (Fix too-short variance slice in `variances_of` cycle recovery)
 - #158233 (Allow the unstable attribute on foreign type)
 - #158433 (Fix inconsistent safety requirement in VecDeque::nonoverlapping_ranges)
 - #158464 (Reorganize `tests/ui/issues` [15/N])
 - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.)
 - #158485 (Reorganize `tests/ui/issues` [16/N])
 - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
@rust-bors rust-bors Bot merged commit f117ef7 into rust-lang:main Jun 28, 2026
14 checks passed
@rustbot rustbot added this to the 1.98.0 milestone Jun 28, 2026
rust-timer added a commit that referenced this pull request Jun 28, 2026
Rollup merge of #157996 - xmakro:perf/projcache-entry-probe, r=nnethercote,Kivooeo

perf: drop the full-crate AST walk in check_unused
faukah pushed a commit to faukah/miri that referenced this pull request Jun 28, 2026
Rollup of 15 pull requests

Successful merges:

 - rust-lang/rust#158497 (stdarch subtree update)
 - rust-lang/rust#152225 (Add supertrait item shadowing for type-level path resolution)
 - rust-lang/rust#158194 (Adds RmetaLinkCache a per-link cache that uses path as the key of dec…)
 - rust-lang/rust#158466 (rustdoc: show impl Trait<Box<Local>> for Foreign, etc on Local's docs)
 - rust-lang/rust#158501 (miri subtree update)
 - rust-lang/rust#153097 (Expand `OptionFlatten`'s iterator methods)
 - rust-lang/rust#157614 (Move tests drop)
 - rust-lang/rust#157996 (perf: drop the full-crate AST walk in check_unused)
 - rust-lang/rust#158163 (Fix too-short variance slice in `variances_of` cycle recovery)
 - rust-lang/rust#158233 (Allow the unstable attribute on foreign type)
 - rust-lang/rust#158433 (Fix inconsistent safety requirement in VecDeque::nonoverlapping_ranges)
 - rust-lang/rust#158464 (Reorganize `tests/ui/issues` [15/N])
 - rust-lang/rust#158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.)
 - rust-lang/rust#158485 (Reorganize `tests/ui/issues` [16/N])
 - rust-lang/rust#158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf-regression Performance regression. 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.

7 participants