Commit d19d7e2
committed
Auto merge of rust-lang#75257 - ssomers:btree_74762_again, r=Mark-Simulacrum
BTreeMap: better way to postpone root access in DrainFilter
A slightly more elegant (in my opinion) adaptation of rust-lang#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-Simulacrum2 files changed
+25
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1697 | 1697 | | |
1698 | 1698 | | |
1699 | 1699 | | |
1700 | | - | |
| 1700 | + | |
1701 | 1701 | | |
1702 | | - | |
1703 | | - | |
| 1702 | + | |
1704 | 1703 | | |
1705 | 1704 | | |
1706 | 1705 | | |
| |||
2645 | 2644 | | |
2646 | 2645 | | |
2647 | 2646 | | |
2648 | | - | |
2649 | | - | |
2650 | | - | |
2651 | | - | |
2652 | | - | |
| 2647 | + | |
| 2648 | + | |
2653 | 2649 | | |
2654 | 2650 | | |
2655 | 2651 | | |
2656 | 2652 | | |
2657 | | - | |
2658 | | - | |
2659 | | - | |
2660 | | - | |
2661 | | - | |
2662 | | - | |
2663 | | - | |
2664 | | - | |
2665 | | - | |
2666 | | - | |
2667 | 2653 | | |
2668 | 2654 | | |
2669 | 2655 | | |
2670 | 2656 | | |
2671 | 2657 | | |
2672 | | - | |
2673 | | - | |
| 2658 | + | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
| 2662 | + | |
| 2663 | + | |
| 2664 | + | |
| 2665 | + | |
2674 | 2666 | | |
2675 | | - | |
2676 | | - | |
| 2667 | + | |
| 2668 | + | |
2677 | 2669 | | |
2678 | 2670 | | |
2679 | 2671 | | |
| |||
2688 | 2680 | | |
2689 | 2681 | | |
2690 | 2682 | | |
2691 | | - | |
| 2683 | + | |
2692 | 2684 | | |
2693 | | - | |
2694 | | - | |
| 2685 | + | |
| 2686 | + | |
2695 | 2687 | | |
2696 | | - | |
| 2688 | + | |
2697 | 2689 | | |
2698 | 2690 | | |
2699 | 2691 | | |
2700 | 2692 | | |
2701 | | - | |
2702 | 2693 | | |
2703 | 2694 | | |
2704 | 2695 | | |
| |||
2719 | 2710 | | |
2720 | 2711 | | |
2721 | 2712 | | |
2722 | | - | |
2723 | | - | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
2724 | 2717 | | |
2725 | 2718 | | |
2726 | 2719 | | |
| |||
2747 | 2740 | | |
2748 | 2741 | | |
2749 | 2742 | | |
2750 | | - | |
| 2743 | + | |
2751 | 2744 | | |
2752 | 2745 | | |
2753 | 2746 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1083 | 1083 | | |
1084 | 1084 | | |
1085 | 1085 | | |
1086 | | - | |
| 1086 | + | |
1087 | 1087 | | |
1088 | 1088 | | |
1089 | 1089 | | |
1090 | 1090 | | |
1091 | | - | |
| 1091 | + | |
1092 | 1092 | | |
1093 | 1093 | | |
1094 | 1094 | | |
| |||
0 commit comments