Skip to content

Conversation

lolbinarycat
Copy link
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-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Oct 8, 2025
@lolbinarycat
Copy link
Contributor Author

@bors2 try @rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Oct 8, 2025
…and, r=<try>

rustdoc: calculate effective visibilities of crates on-demand
@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 8, 2025
@rust-bors
Copy link

rust-bors bot commented Oct 8, 2025

☀️ Try build successful (CI)
Build commit: b0cbaf1 (b0cbaf1f07e2a7e0dc40cf1c48218609ef16d932, parent: 82224f6891c7e7aa0c6c865aa825100b3ea2d0fb)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b0cbaf1): 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.2% [0.1%, 0.3%] 7
Regressions ❌
(secondary)
0.1% [0.0%, 0.2%] 5
Improvements ✅
(primary)
-0.2% [-0.2%, -0.2%] 1
Improvements ✅
(secondary)
-0.2% [-0.6%, -0.1%] 5
All ❌✅ (primary) 0.1% [-0.2%, 0.3%] 8

Max RSS (memory usage)

Results (primary 2.5%, secondary 1.7%)

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

mean range count
Regressions ❌
(primary)
2.5% [2.5%, 2.5%] 1
Regressions ❌
(secondary)
1.7% [1.7%, 1.7%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.5% [2.5%, 2.5%] 1

Cycles

Results (primary 2.1%, secondary -1.0%)

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

mean range count
Regressions ❌
(primary)
2.1% [2.1%, 2.1%] 1
Regressions ❌
(secondary)
2.8% [2.8%, 2.8%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.9% [-3.8%, -2.1%] 2
All ❌✅ (primary) 2.1% [2.1%, 2.1%] 1

Binary size

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

Bootstrap: 473.927s -> 473.682s (-0.05%)
Artifact size: 388.42 MiB -> 388.42 MiB (-0.00%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Oct 8, 2025
@lolbinarycat
Copy link
Contributor Author

I'm curious how this would perform on something much larger like zed. The large-workspace case did see an improvement around what i estimated (0.5%)

unfortunatly the overhead of the locking is fairly significant. there are a few different things that could be tried to mitegate that, such as using a datastructure with multiple levels of nested maps (Map<CrateNum, DefIdSet>) so that the write lock only needs to be acquired momentarily, instead of being held through the entire traversal process.

@lolbinarycat
Copy link
Contributor Author

Alright, I tried a few alternatives and none worked. Could maybe be workable with a bit more effort. Also worth considering if the current change is just "good enough" already.

the two-stage hashmap design didn't work because it's not actually correct, presumably because of inlined items or something similar (making it so a crate can contain DefIds that are actually from a different crate) (do we need to be traversing into inlined modules, actually?)

DefIdSet is UnordSet which is not IntoIterator and provides no alternative method for merging. I guess I could use BTreeMap<DefId>?

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-author Status: This is awaiting some action (such as code changes or more information) from the author. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants