Skip to content

Use less HIR to compute effective visibility. #144554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cjgillot
Copy link
Contributor

r? @ghost

@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 Jul 27, 2025
@cjgillot
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Jul 27, 2025

⌛ Trying commit 032e102 with merge 1910327

To cancel the try build, run the command @bors try cancel.

rust-bors bot added a commit that referenced this pull request Jul 27, 2025
Use less HIR to compute effective visibility.
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 27, 2025
@rust-bors
Copy link

rust-bors bot commented Jul 28, 2025

☀️ Try build successful (CI)
Build commit: 1910327 (1910327beace40b61f424d29a0ebbe2de5e3311a, parent: f8e355c230c6eb7b78ffce6a92fd81f78c890524)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1910327): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

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.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@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)
1.0% [0.6%, 1.2%] 8
Improvements ✅
(primary)
-0.1% [-0.1%, -0.1%] 1
Improvements ✅
(secondary)
-0.8% [-1.0%, -0.3%] 8
All ❌✅ (primary) -0.1% [-0.1%, -0.1%] 1

Max RSS (memory usage)

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

Cycles

Results (primary -1.2%)

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

mean range count
Regressions ❌
(primary)
1.7% [1.7%, 1.7%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.7% [-3.2%, -2.1%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.2% [-3.2%, 1.7%] 3

Binary size

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

Bootstrap: 465.942s -> 467.68s (0.37%)
Artifact size: 376.74 MiB -> 376.90 MiB (0.04%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jul 28, 2025
@bors

This comment was marked as resolved.

@petrochenkov petrochenkov self-assigned this Jul 28, 2025
@bors

This comment was marked as resolved.

@cjgillot cjgillot 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 Jul 31, 2025
@cjgillot cjgillot marked this pull request as ready for review July 31, 2025 22:33
@@ -1836,8 +1847,14 @@ fn effective_visibilities(tcx: TyCtxt<'_>, (): ()) -> &EffectiveVisibilities {
visitor.changed = false;
}

let crate_items = tcx.hir_crate_items(());
loop {
Copy link
Contributor

Choose a reason for hiding this comment

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

This PR does maybe half of work required to turn this loop into a work queue of OwnerIds (to avoid visiting the crate repeatedly until the algorithm saturates).

@petrochenkov
Copy link
Contributor

r=me with the nits addressed.
@rustbot author

@rustbot rustbot added 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. labels Aug 1, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 1, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@petrochenkov
Copy link
Contributor

r=me after squashing commits.

@cjgillot
Copy link
Contributor Author

cjgillot commented Aug 2, 2025

@bors r=petrochenkov

@bors
Copy link
Collaborator

bors commented Aug 2, 2025

📌 Commit 63e1327 has been approved by petrochenkov

It is now in the queue for this repository.

@bors bors 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 Aug 2, 2025
bors added a commit that referenced this pull request Aug 2, 2025
Use less HIR to compute effective visibility.

r? `@ghost`
@bors
Copy link
Collaborator

bors commented Aug 2, 2025

⌛ Testing commit 63e1327 with merge 6d091b2...

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.

5 participants