BTreeMap: reuse BoxedNode instances directly instead of their contents #77408
BTreeMap: reuse BoxedNode instances directly instead of their contents #77408ssomers wants to merge 1 commit intorust-lang:masterfrom ssomers:btree_cleanup_6
Conversation
|
Benchmarks pretend to be a bit faster, despite push/pop being relatively rare. |
There was a problem hiding this comment.
This feels like we're (potentially) doing needless work -- this looks equivalent to internal_node.edges[0].assume_init_read() which avoids the spurious write to edges -- can we use that instead?
(I suspect in practice LLVM probably ignores writing uninitialized data to some region of memory, but not sure).
There was a problem hiding this comment.
Indeed and I did the logical equivalent ptr::read on the other side.
|
Swapped the 2 commits here and based on #77471 to avoid a benign conflict |
|
Nothing wrong, just easier to follow if I do the first commit separately. |
…ulacrum BTreeMap: type-specific variants of node_as_mut and cast_unchecked Improves debug checking and shortens some expressions. Extracted from rust-lang#77408
…ulacrum BTreeMap: type-specific variants of node_as_mut and cast_unchecked Improves debug checking and shortens some expressions. Extracted from rust-lang#77408
…ulacrum BTreeMap: type-specific variants of node_as_mut and cast_unchecked Improves debug checking and shortens some expressions. Extracted from rust-lang#77408
|
Still showing the same improvement, but now with the opposite on sets. |
|
@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author |
|
@bors r+ rollup=never |
|
📌 Commit 184735a has been approved by |
|
Okay. I don't mind the extra PR. @bors r+ |
|
📌 Commit 184735a has been approved by |
|
⌛ Testing commit 184735a with merge 8682c9fe0f1a3307f310ee5e5b4a66f93c5f9466... |
r? @Mark-Simulacrum