-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
BTreeMap: avoid slices even more #76790
Conversation
The btree benchmarks of mutable behaviour rely heavily on
|
I think I recall seeing this pattern and being worried about it, so this definitely looks good to me. @bors r+ rollup=never (perf effects not unlikely) |
📌 Commit 378b643 has been approved by |
⌛ Testing commit 378b643 with merge 9dfeaa9c374c596c91380f6aa857262d23169fb0... |
💥 Test timed out |
@bors retry |
⌛ Testing commit 378b643 with merge 999503af5648bb816ae73899f12ee59ae8563280... |
💔 Test failed - checks-actions |
More timeouts, if you ask me. |
@bors retry |
☀️ Test successful - checks-actions, checks-azure |
Epilogue to #73971: it seems the compiler is unable to realize that creating a slice and
get_unchecked
-ing one element is a simple fetch. So try to spell it out for the only remaining but often invoked case.Also, the previous code doesn't seem fair game to me, using
get_unchecked
to reach beyond the end of a slice. Although the local functionslice_insert
also does that.r? @Mark-Simulacrum