-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Replace rustc_data_structures::thin_vec::ThinVec
with thin_vec::ThinVec
#100869
Conversation
Some changes occurred in src/librustdoc/clean/types.rs cc @camelid |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
4b7fc2b
to
2c4e3fd
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 2c4e3fd9bb4cb00340159b6a3e1b4bfdaff1e22c with merge ffb3c6740056e998519f02c0dbb8072c2341c73f... |
☀️ Try build successful - checks-actions |
Queued ffb3c6740056e998519f02c0dbb8072c2341c73f with parent d0ea1d7, future comparison URL. |
Finished benchmarking commit (ffb3c6740056e998519f02c0dbb8072c2341c73f): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking 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 Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Footnotes |
@nnethercote I didn't check the code yet, just read your description but ... I was wondering if the perf results were the results you were expecting :). Can you comment on that?. |
Yes, this is disappointing. I'll have to see if I can optimize |
I already tried this once in |
Is there a PR? |
(I already fixed a bug in |
Hmm, I found #92514, but that's about thin slices, not thin vecs. I probably didn't even send a PR and just tested it locally, but I remember using the |
Hopefully Gankra/thin-vec#34 will fix most/all of the problems. |
2c4e3fd
to
745ad84
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 745ad84 with merge 5c6507f9a3435a7f5961c0f6e771d5831934d8e4... |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 78f83f0 with merge ea65f3049b7a96d203ed2fc38f2471bbb0e0cfa5... |
☀️ Try build successful - checks-actions |
Queued ea65f3049b7a96d203ed2fc38f2471bbb0e0cfa5 with parent 94b2b15, future comparison URL. |
Finished benchmarking commit (ea65f3049b7a96d203ed2fc38f2471bbb0e0cfa5): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking 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 Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Footnotes |
@spastorino The improvements now slightly outweigh the regressions. I don't entirely trust the last set of results, because I think there is some noise in these results. But I think it's close enough to performance-neutral to proceed. |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (eac6c33): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Footnotes |
Ugh, the post-merge perf run looked very different to the pre-merge perf run, despite there being no change to the code. Clearly a lot of noise here, and hard to know which results to trust. I'll see if I can get any follow-up improvements. |
@nnethercote any ideas on follow ups here? The results seem like they're partially noise, but some would appear to be real issues. |
Nothing right now, though I have a couple of experiments still to run. But |
rustc_data_structures::thin_vec::ThinVec
looks like this:It's just a zero word if the vector is empty, but requires two
allocations if it is non-empty. So it's only usable in cases where the
vector is empty most of the time.
This commit removes it in favour of
thin_vec::ThinVec
, which is alsoword-sized, but stores the length and capacity in the same allocation as
the elements. It's good in a wider variety of situation, e.g. in enum
variants where the vector is usually/always non-empty.
The commit also:
Cargo.toml
dependency lists, to make additions easier.use
item lists, to make additions easier.clean_trait_ref_with_bindings
to take aThinVec<TypeBinding>
rather than a&[TypeBinding]
, because thisavoid some unnecessary allocations.
r? @spastorino