-
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
rustdoc: Use ThinVec
in a few places
#83828
Conversation
r? @lcnr (rust-highfive has picked a reviewer for you, use r? to override) |
r? @ghost (also, this is a T-rustdoc PR, but it includes commits from a PR that modifies the compiler) |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit b98549512944f6ac37635db69053a1f609b24e86 with merge b9fd9ecb9bab4884a084e182d2af487064b59de3... |
☀️ Try build successful - checks-actions |
Queued b9fd9ecb9bab4884a084e182d2af487064b59de3 with parent 97717a5, future comparison URL. |
Finished benchmarking try commit (b9fd9ecb9bab4884a084e182d2af487064b59de3): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
This is a good idea. I'll try doing this in #83833. |
Wow, that was actually a bigger improvement than I expected! |
crate primitives: ThinVec<(DefId, PrimitiveType)>, | ||
crate keywords: ThinVec<(DefId, Symbol)>, |
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.
Why not make it thinner by combining this two into one pointer?
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.
What do you mean? These are stored in the ThinVec, on the heap, not on the stack.
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.
Yes, but since both of them are as rare, so we can just combine both into one pointer rather than two right? But yeah, if one is needed then we need the pointer already.
Only useful if both are always together at the same time.
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.
It's possible that combining them into one boxed field would make it smaller, but
- that would require code changes, and the slight perf improvement is likely not worth it;
- there probably won't be much of a perf improvement because padding may take up the space anyway.
I can't see much improvements, the benchmark seemed neutral. How do you all see that? Wait, do you mean all those |
b985495
to
a5f6dd1
Compare
Almost every crate has no primitives and no keywords defined in it, so using `ThinVec` should make some types smaller.
a5f6dd1
to
3ea8ebc
Compare
@bors r+ rollup=never |
📌 Commit 3ea8ebc has been approved by |
☀️ Test successful - checks-actions |
Interestingly, the perf run after merge didn't show the instruction count improvements that the earlier perf run showed. Perhaps that could be due to the changes that were made in #83821 after the earlier perf run? However, there did seem to be some max-rss improvements in |
Almost every crate has no primitives and no keywords defined in it, so
using
ThinVec
should make some types smaller.