-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Remove most box syntax from librustdoc #99066
Conversation
Some changes occurred in src/librustdoc/clean/types.rs cc @camelid |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 5e1e89e5d4b6c9b3fa076a17aa5455471beb477c with merge 567cf89ba17f13bc490de32582f36c7ed9c07c62... |
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
Queued 567cf89ba17f13bc490de32582f36c7ed9c07c62 with parent 45263fc, future comparison URL. |
I'm no longer on the rustdoc team, please don't assign me on PRs. r? rust-lang/rustdoc |
@jyn514 didn't know that, sorry! |
Finished benchmarking commit (567cf89ba17f13bc490de32582f36c7ed9c07c62): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Footnotes |
The function pointer should be extremely small, close to pointer size.
Doctests are fairly cold code, so even if there is a regression, which i doubt, it won't matter.
5e1e89e
to
8728834
Compare
Okay so the regression is still around. I've split up the change into multiple commits. I've sorted them by how much performance-relevant I think they are, so mostly by size if the type is obvious. This is of course not perfect, e.g. cold code should be less performance relevant than hot code, and what also matters is which optimizations LLVM is doing. But I'm doing a first approximation for now. I was surprised by how large Can this get another perf run? Then I'll add back the larger structs and will ask for another perf run (because it's an effect close to the noise level). |
|
This comment has been minimized.
This comment has been minimized.
The iterators created should be pretty light weight.
Attributes only has 48 bytes according to compiler internal rustdoc.
ImplItem only has 80 bytes according to compiler internal rustdoc.
The type has 80 bytes according to compiler internal rustdoc.
8728834
to
3fa637d
Compare
☀️ Try build successful - checks-actions |
Queued 3be870053e75dea2d9bcebccada54f6cc32df79d with parent b3f4c31, future comparison URL. |
Finished benchmarking commit (3be870053e75dea2d9bcebccada54f6cc32df79d): comparison url. Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results
CyclesThis benchmark run did not return any relevant results for this metric. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Footnotes |
Yes, so it's the |
@bors r+ |
⌛ Testing commit 3d2494d with merge 75b4af84d83713ae1497e54a971e82c0e004e53d... |
💔 Test failed - checks-actions |
The job Click to see the possible cause of the failure (guessed by this bot)
|
@bors retry |
☀️ Test successful - checks-actions |
Finished benchmarking commit (a639f89): comparison url. Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
Remove remaining uses of box syntax from librustdoc Remove the remaining uses of box syntax from librustdoc. Followup of rust-lang#99066 where these changes were split out because they were responsible for a small but noticeable regression. This PR avoids the regression by boxing some large variants of `ItemKind` to reduce the enum's size by half from 224 bytes to 112 bytes (on x86-64). This should also help with reducing memory usage.
This is the second attempt after the librustdoc specific changes have been reverted from #87781 in #89134, due to a minor, but exant regression caused by the changes.
There have been some changes to librustdoc in the past and maybe thanks to them there is no regression any more. If there is still a regression, one can investigate further and maybe find ways to fix the regressions. Thus, i request a perf run.Edit: turns out there is still a regression, but it's caused only by a subset of the changes. So I've changed this PR to only contains the changes that don't cause any performance regressions, keeping the regression causing changes for a later PR.