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
Don't store primitives
in Crate
#98694
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 40f87e9080ff4793d31d7a2caa5b8926381b07e6 with merge 1c2bbd3c54cfe7f7c9eeb92061aba8b058199f8f... |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit e6e332763ca401388dbf4d465bc4c9b520f5dfc7 with merge 7e0fe6422706156646410c8e6bb63d021ff30579... |
@@ -73,7 +73,7 @@ pub(crate) fn krate(cx: &mut DocContext<'_>) -> Crate { | |||
})); | |||
} | |||
|
|||
Crate { module, primitives, external_traits: cx.external_traits.clone() } | |||
Crate { module, external_traits: cx.external_traits.clone() } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, I'm not useful this change is since you still call crate.primitives()
, you just don't store it afterwards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but Crate
is passed by value a lot, and this cuts down on its size. Might not help a ton, but I thought worth a try.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to cache ExternalCrate::primitives
as a OnceCell like primitive_locations
, but ran into issues since primitives
is called for multiple different crates, so you can't use OnceCell and call it a day.
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Once you have fixed the CI failures, we can run a perf check to see the result. |
It can be used on-demand like all the other uses.
Time for a new perf check. @bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 975151a with merge cb872ab1aedfa67ece4d7960a246bd7f26f92807... |
☀️ Try build successful - checks-actions |
Queued cb872ab1aedfa67ece4d7960a246bd7f26f92807 with parent c461f7a, future comparison URL. |
Finished benchmarking commit (cb872ab1aedfa67ece4d7960a246bd7f26f92807): 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. @bors rollup=never Footnotes |
All right, looks like this just makes perf worse, and I don't think the code simplification is worth it. Perhaps caching |
It can be used on-demand like all the other uses.