Skip to content

BTreeMap: better way to postpone root access in DrainFilter - #75257

Merged
bors merged 1 commit into
rust-lang:masterfrom
ssomers:btree_74762_again
Aug 8, 2020
Merged

bors merged 1 commit into
rust-lang:masterfrom
ssomers:btree_74762_again

Conversation

@ssomers

@ssomers ssomers commented Aug 7, 2020

Copy link
Copy Markdown
Contributor

A slightly more elegant (in my opinion) adaptation of #74762. Benchmarks seem irrationally pleased to:

benchcmp old new --threshold 5
 name                                           old ns/iter  new ns/iter  diff ns/iter   diff %  speedup
 btree::map::clone_fat_100_and_remove_all       215,182      185,052           -30,130  -14.00%   x 1.16
 btree::map::clone_fat_100_and_remove_half      139,667      127,945           -11,722   -8.39%   x 1.09
 btree::map::clone_fat_val_100_and_remove_all   96,755       81,279            -15,476  -16.00%   x 1.19
 btree::map::clone_fat_val_100_and_remove_half  64,678       56,911             -7,767  -12.01%   x 1.14
 btree::map::find_rand_100                      18           17                     -1   -5.56%   x 1.06
 btree::map::first_and_last_0                   33           35                      2    6.06%   x 0.94
 btree::map::first_and_last_100                 40           54                     14   35.00%   x 0.74
 btree::map::insert_rand_100                    45           42                     -3   -6.67%   x 1.07
 btree::map::insert_rand_10_000                 45           41                     -4   -8.89%   x 1.10
 btree::map::iter_0                             2,010        1,759                -251  -12.49%   x 1.14
 btree::map::iter_100                           3,514        2,764                -750  -21.34%   x 1.27
 btree::map::iter_10k                           4,018        3,768                -250   -6.22%   x 1.07
 btree::map::range_unbounded_unbounded          37,269       28,929             -8,340  -22.38%   x 1.29
 btree::map::range_unbounded_vs_iter            31,518       28,814             -2,704   -8.58%   x 1.09

r? @Mark-Simulacrum

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 7, 2020
@Mark-Simulacrum

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Aug 7, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit 85a7879 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 7, 2020
@bors

bors commented Aug 8, 2020

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 85a7879 with merge d19d7e2...

@bors

bors commented Aug 8, 2020

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-actions, checks-azure
Approved by: Mark-Simulacrum
Pushing d19d7e2 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 8, 2020
@bors
bors merged commit d19d7e2 into rust-lang:master Aug 8, 2020
@ssomers
ssomers deleted the btree_74762_again branch August 8, 2020 09:51
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 15, 2020
…mulacrum

Revert the fundamental changes in rust-lang#74762 and rust-lang#75257

Before possibly going over to rust-lang#75487. Also contains some added and fixed comments.

r? @Mark-Simulacrum
@cuviper cuviper added this to the 1.47.0 milestone May 2, 2024
@clarfonthey clarfonthey added A-btree Area: `std::collections::{BTreeMap, BTreeSet}` A-collections Area: `std::collections` (prefer A-binaryheap, A-btree, A-hashtable, A-linkedlist, A-vecdeque) labels Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-btree Area: `std::collections::{BTreeMap, BTreeSet}` A-collections Area: `std::collections` (prefer A-binaryheap, A-btree, A-hashtable, A-linkedlist, A-vecdeque) merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants