Uh oh!
There was an error while loading. Please reload this page.
Keep track of position when deleting from a BTreeMap - #70795
Conversation
Uh oh!
There was an error while loading. Please reload this page.
This improves the performance of drain_filter and is needed for future Cursor support for BTreeMap.
a56b338 to
7365748CompareMark-Simulacrum
commented
Apr 5, 2020
Looks good to me, thanks! We should really look into caching the last_leaf_edge/first_leaf_edge I suspect, to avoid the (presumably) fairly expensive tree traversals on every non-leaf node we're visiting. @bors r+ |
bors
commented
Apr 5, 2020
📌 Commit 7365748 has been approved by |
Uh oh!
There was an error while loading. Please reload this page.
Mark-Simulacrum
commented
Apr 5, 2020
Oh, actually, one nit, but then r=me @bors r- |
Uh oh!
There was an error while loading. Please reload this page.
| AtRoot, | ||
| Merged(Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::Edge>, bool, usize), | ||
| Stole(NodeRef<marker::Mut<'a>, K, V, marker::Internal>, bool), | ||
| Stole(bool), |
There was a problem hiding this comment.
Nice, but now Stole is begging me to be split up into something like StoleFromLeft and StoleFromRight.
There was a problem hiding this comment.
But then I would have to do the same with MergedWithRight and MergedWithLeft, and that makes just makes the match above more complicated.
Mark-Simulacrum
commented
Apr 5, 2020
I think further improvements to the enum can be cleared up later, for now this seems fine. @bors r+ |
bors
commented
Apr 5, 2020
📌 Commit 51357cf has been approved by |
Rollup of 5 pull requests Successful merges: - rust-lang#67797 (Query-ify Instance::resolve) - rust-lang#70777 (Don't import integer and float modules, use assoc consts) - rust-lang#70795 (Keep track of position when deleting from a BTreeMap) - rust-lang#70812 (Do not use "nil" to refer to `()`) - rust-lang#70815 (Enable layout debugging for `impl Trait` type aliases) Failed merges: r? @ghost
ssomers
commented
Apr 6, 2020
Performance measurement of this PR against its master revision: In short, some backlash on |
Amanieu
commented
Apr 7, 2020
I'm getting completely different results on my system: |
ssomers
commented
Apr 7, 2020
Well, completely different... both say there's no significant change to worry about. I shouldn't have written there is backlash, that's just what the numbers seemed to suggest. |
…, r=Amanieu Remove the Ord bound that was plaguing drain_filter Now that rust-lang#70795 made it superfluous. Also removes superfluous lifetime specifiers (at least I think they are).
…, r=Amanieu Remove the Ord bound that was plaguing drain_filter Now that rust-lang#70795 made it superfluous. Also removes superfluous lifetime specifiers (at least I think they are).
ssomers
commented
Apr 12, 2020
I rebuilt the commits (the base and tip of your branch) and tweaked cargo-benchcmp to pick the best result for each benchmark over many runs (whereas before I hand-picked the seemingly best output file from 5 runs). Now I seem to get quite consistent output, within 2%, like: Of course, it doesn't mean that the code tested is a wee bit faster or slower, probably just that, for this set of benchmarks, the optimizer ends up favouring other benchmarks than it did before. And I wouldn't be surprised that the software picks up on this and starts countermeasures so it can keep on doing what it wants to. |
This improves the performance of drain_filter and is needed for future Cursor support for BTreeMap.
cc @ssomers
r? @Mark-Simulacrum