-
Notifications
You must be signed in to change notification settings - Fork 13k
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
store ObligationCause
on the heap
#72962
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit 91f5ff558068ff7659e7d7c87b62594ffeb9ca7f with merge 7e933e1ada25d4898101cc7e4e2fa77498f948e0... |
@bors try- |
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit aef40a48b1750ead607eef1a4d7b19c345ea200a with merge 8ff82fab989f4a07dfd168708da2ffc413addb04... |
☀️ Try build successful - checks-azure |
Queued 8ff82fab989f4a07dfd168708da2ffc413addb04 with parent 56daaf6, future comparison URL. |
Finished benchmarking try commit (8ff82fab989f4a07dfd168708da2ffc413addb04): comparison url. |
This perf is interesting. I think this PR would be worth it as is. I might try and look a bit more into why some benchmarks are negative and what can be done here... |
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit 61429d6b01a297568decae2ea552e8df6710ff2b with merge ba0ecc9e775e63cb1e782322e6ead5f8b018a463... |
☀️ Try build successful - checks-azure |
Queued ba0ecc9e775e63cb1e782322e6ead5f8b018a463 with parent 3d5d0f8, future comparison URL. |
Finished benchmarking try commit (ba0ecc9e775e63cb1e782322e6ead5f8b018a463): comparison url. |
:( |
@jonas-schievink it's still in the queue: https://perf.rust-lang.org/status.html but it has been:
for 2 hours so it appears to be stuck. |
Sorry, we were migrating to a new backend for the site (and somewhat the collector), the link(s) should be good to go now. |
Perf is looking fairly good already, I want to look into 1 more thing before this is merged though |
Thank you! @bors r+ rollup=never |
📌 Commit 57fc011ae4ff3c925d61b8b8cf7c252b3dfb6705 has been approved by |
Oh, and if you feel like squashing this, ping me and I'll re-approve. |
@ecstatic-morse done 👍 |
@bors r+ |
📌 Commit ea668d9 has been approved by |
I'm happy to be CC'd on things like this, thanks. |
@bors p=1 |
☀️ Test successful - checks-azure |
Perf results from landing show a win, as expected. Nice work! |
This was a clear perf win, but the number of additional allocations done is significant. DHAT shows me that, on numerous benchmarks, around 5% of all allocations done are for |
I didn't yet try storing only the I don't have the time to try this myself though |
PR rust-lang#72962 shrank `Obligation` at the cost of more heap allocations; overall it was a perf win. This PR partly undoes that change, making `Obligation` a little bigger (though not as big as it was) while reducing the number of heap allocations.
I've tried this in #73983. |
Stores
ObligationCause
on the heap using anRc
.This PR trades off some transient memory allocations to reduce the size of–and thus the number of instructions required to memcpy–a few widely used data structures in trait solving.