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

Merged
merged 1 commit into from
Aug 2, 2025

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
Copy link
Collaborator

bors commented Aug 2, 2025

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

@bors
Copy link
Collaborator

bors commented Aug 2, 2025

☀️ Test successful - checks-actions
Approved by: petrochenkov
Pushing 6d091b2 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 2, 2025
@bors bors merged commit 6d091b2 into rust-lang:master Aug 2, 2025
11 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Aug 2, 2025
Copy link
Contributor

github-actions bot commented Aug 2, 2025

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 889701d (parent) -> 6d091b2 (this PR)

Test differences

Show 3 test diffs

3 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 6d091b2baa33698682453c7bb72809554204e434 --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-arm-linux-musl: 5552.5s -> 13776.5s (148.1%)
  2. dist-x86_64-illumos: 5820.6s -> 12774.3s (119.5%)
  3. dist-ohos-armv7: 3916.7s -> 7692.7s (96.4%)
  4. dist-x86_64-freebsd: 4859.0s -> 9423.4s (93.9%)
  5. dist-x86_64-musl: 7282.1s -> 13716.5s (88.4%)
  6. dist-ohos-x86_64: 4138.5s -> 7743.6s (87.1%)
  7. dist-ohos-aarch64: 4247.0s -> 7716.3s (81.7%)
  8. dist-x86_64-netbsd: 4693.2s -> 8248.2s (75.7%)
  9. dist-powerpc64le-linux-musl: 5184.2s -> 8872.4s (71.1%)
  10. dist-arm-linux-gnueabi: 4657.1s -> 7959.1s (70.9%)
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
Collaborator

Finished benchmarking commit (6d091b2): comparison URL.

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

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.2% [0.2%, 0.3%] 6
Regressions ❌
(secondary)
0.3% [0.1%, 0.5%] 7
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.2%, -0.1%] 5
All ❌✅ (primary) 0.2% [0.2%, 0.3%] 6

Max RSS (memory usage)

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

Cycles

Results (primary -2.3%)

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

Binary size

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

Bootstrap: 467.526s -> 469.09s (0.33%)
Artifact size: 376.82 MiB -> 376.98 MiB (0.04%)

@cjgillot cjgillot deleted the no-hir-eff-vis branch August 2, 2025 16:12
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. 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