Refactor: Add add/sub to TaggedLen (#570) - #572
Conversation
alejandro-vaz
left a comment
There was a problem hiding this comment.
looks good
what do benchmarks say about performance??
| @@ -73,7 +87,8 @@ impl<T> TaggedLen<T> { | |||
| /// This decreases the length without rereading the `on heap` flag. | |||
| #[inline] | |||
| pub const unsafe fn decrement(&mut self) { | |||
| debug_assert!(self.value() > 0); | |||
| self.0 -= if Self::IS_ZST { 1 } else { 0b10 }; | |||
| unsafe { | |||
| self.sub(1); | |||
| } | |||
| } | |||
There was a problem hiding this comment.
also, can increment/decrement simply be removed and replaced for add and sub wherever it's used and performance would still be the same?? that'd be much simpler
There was a problem hiding this comment.
I removed the increment and decrement methods as suggested!
Click here to see the full `cargo bench` output
bench_push time: [382.03 ns 406.06 ns 430.76 ns]
change: [−3.2524% +5.3613% +15.196%] (p = 0.25 > 0.05)
No change in performance detected.
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mild
bench_push_small time: [39.920 ns 40.496 ns 41.151 ns]
change: [−6.2406% −1.5471% +3.3612%] (p = 0.55 > 0.05)
No change in performance detected.
Found 9 outliers among 100 measurements (9.00%)
3 (3.00%) high mild
6 (6.00%) high severe
bench_insert_push time: [402.87 ns 412.45 ns 423.81 ns]
change: [−5.5713% −0.2386% +5.1166%] (p = 0.93 > 0.05)
No change in performance detected.
Found 6 outliers among 100 measurements (6.00%)
6 (6.00%) high severe
bench_insert_push_small time: [43.763 ns 45.887 ns 48.173 ns]
change: [−17.820% −11.361% −4.4490%] (p = 0.00 < 0.05)
Performance has improved.
Found 17 outliers among 100 measurements (17.00%)
2 (2.00%) high mild
15 (15.00%) high severe
bench_insert time: [1.0676 µs 1.0831 µs 1.1003 µs]
change: [−5.1953% −1.1182% +3.2142%] (p = 0.61 > 0.05)
No change in performance detected.
Found 6 outliers among 100 measurements (6.00%)
3 (3.00%) high mild
3 (3.00%) high severe
bench_insert_small time: [139.38 ns 140.91 ns 142.51 ns]
change: [−11.081% −6.6737% −2.4539%] (p = 0.00 < 0.05)
Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
4 (4.00%) high mild
2 (2.00%) high severe
bench_remove time: [795.45 ns 807.05 ns 821.04 ns]
change: [−17.231% −12.941% −8.1138%] (p = 0.00 < 0.05)
Performance has improved.
Found 10 outliers among 100 measurements (10.00%)
5 (5.00%) high mild
5 (5.00%) high severe
bench_remove_small time: [105.52 ns 110.94 ns 117.21 ns]
change: [−14.502% −7.1868% +0.6223%] (p = 0.08 > 0.05)
No change in performance detected.
Found 17 outliers among 100 measurements (17.00%)
6 (6.00%) high mild
11 (11.00%) high severe
bench_extend time: [55.078 ns 55.734 ns 56.600 ns]
change: [−8.9690% −1.1983% +7.1268%] (p = 0.77 > 0.05)
No change in performance detected.
Found 14 outliers among 100 measurements (14.00%)
5 (5.00%) high mild
9 (9.00%) high severe
bench_extend_small time: [14.540 ns 14.791 ns 15.051 ns]
change: [−11.083% −6.4003% −1.4987%] (p = 0.01 < 0.05)
Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
3 (3.00%) high mild
3 (3.00%) high severe
bench_extend_filtered time: [120.16 ns 124.65 ns 130.38 ns]
change: [−7.6409% −0.8681% +5.5219%] (p = 0.80 > 0.05)
No change in performance detected.
Found 14 outliers among 100 measurements (14.00%)
6 (6.00%) high mild
8 (8.00%) high severe
bench_extend_filtered_small
time: [17.704 ns 18.560 ns 19.537 ns]
change: [−15.100% −8.0548% +0.1711%] (p = 0.05 < 0.05)
Change within noise threshold.
Found 17 outliers among 100 measurements (17.00%)
5 (5.00%) high mild
12 (12.00%) high severe
bench_from_iter time: [50.938 ns 53.462 ns 56.457 ns]
change: [+0.5138% +7.0521% +13.260%] (p = 0.03 < 0.05)
Change within noise threshold.
Found 20 outliers among 100 measurements (20.00%)
5 (5.00%) high mild
15 (15.00%) high severe
bench_from_iter_small time: [12.426 ns 12.740 ns 13.090 ns]
change: [+8.3222% +12.452% +16.986%] (p = 0.00 < 0.05)
Performance has regressed.
Found 10 outliers among 100 measurements (10.00%)
3 (3.00%) high mild
7 (7.00%) high severe
bench_from_slice time: [48.208 ns 48.859 ns 49.622 ns]
change: [−2.8802% −1.4177% −0.0211%] (p = 0.05 > 0.05)
No change in performance detected.
Found 10 outliers among 100 measurements (10.00%)
8 (8.00%) high mild
2 (2.00%) high severe
bench_from_slice_small time: [12.579 ns 12.807 ns 13.026 ns]
change: [−0.0897% +3.3714% +7.6282%] (p = 0.09 > 0.05)
No change in performance detected.
Found 6 outliers among 100 measurements (6.00%)
2 (2.00%) high mild
4 (4.00%) high severe
bench_extend_from_slice time: [52.803 ns 54.282 ns 55.973 ns]
change: [−13.652% −10.031% −6.5263%] (p = 0.00 < 0.05)
Performance has improved.
Found 12 outliers among 100 measurements (12.00%)
7 (7.00%) high mild
5 (5.00%) high severe
bench_extend_from_slice_small
time: [14.907 ns 15.484 ns 16.151 ns]
change: [−0.6059% +3.0351% +6.9035%] (p = 0.13 > 0.05)
No change in performance detected.
Found 16 outliers among 100 measurements (16.00%)
3 (3.00%) high mild
13 (13.00%) high severe
bench_macro_from_elem time: [62.706 ns 66.269 ns 70.772 ns]
change: [−4.3973% −0.1053% +4.5702%] (p = 0.97 > 0.05)
No change in performance detected.
Found 20 outliers among 100 measurements (20.00%)
7 (7.00%) high mild
13 (13.00%) high severe
bench_macro_from_elem_small
time: [15.863 ns 16.740 ns 17.713 ns]
change: [+5.5950% +12.889% +20.048%] (p = 0.00 < 0.05)
Performance has regressed.
Found 19 outliers among 100 measurements (19.00%)
6 (6.00%) high mild
13 (13.00%) high severe
bench_pushpop time: [186.68 ns 188.67 ns 190.81 ns]
change: [−3.3417% −0.5026% +2.6418%] (p = 0.78 > 0.05)
No change in performance detected.
Found 4 outliers among 100 measurements (4.00%)
4 (4.00%) high severe
bench_retain_mut_half time: [59.756 ns 60.768 ns 62.070 ns]
change: [−5.2657% −0.4646% +4.6597%] (p = 0.86 > 0.05)
No change in performance detected.
Found 8 outliers among 100 measurements (8.00%)
1 (1.00%) high mild
7 (7.00%) high severe
bench_retain_mut_half_small
time: [35.301 ns 35.845 ns 36.459 ns]
change: [+1.7651% +3.9540% +6.1533%] (p = 0.00 < 0.05)
Performance has regressed.
Found 11 outliers among 100 measurements (11.00%)
5 (5.00%) high mild
6 (6.00%) high severe
bench_retain_mut_all time: [27.618 ns 27.901 ns 28.225 ns]
change: [−3.8084% −1.4912% +0.3824%] (p = 0.18 > 0.05)
No change in performance detected.
Found 21 outliers among 100 measurements (21.00%)
11 (11.00%) high mild
10 (10.00%) high severe
bench_retain_mut_all_small
time: [27.615 ns 27.864 ns 28.147 ns]
change: [−0.3389% +2.7442% +7.1297%] (p = 0.15 > 0.05)
No change in performance detected.
Found 11 outliers among 100 measurements (11.00%)
3 (3.00%) high mild
8 (8.00%) high severe
bench_retain_mut_none time: [27.735 ns 28.023 ns 28.339 ns]
change: [−2.9847% +0.0229% +3.6661%] (p = 0.99 > 0.05)
No change in performance detected.
Found 8 outliers among 100 measurements (8.00%)
4 (4.00%) high mild
4 (4.00%) high severe
bench_retain_mut_none_small
time: [25.518 ns 25.978 ns 26.539 ns]
change: [−5.7320% −2.5727% +1.3907%] (p = 0.15 > 0.05)
No change in performance detected.
Found 8 outliers among 100 measurements (8.00%)
3 (3.00%) high mild
5 (5.00%) high severe
bench_push_vec time: [386.51 ns 409.64 ns 436.08 ns]
change: [+8.4927% +14.782% +22.088%] (p = 0.00 < 0.05)
Performance has regressed.
Found 14 outliers among 100 measurements (14.00%)
9 (9.00%) high mild
5 (5.00%) high severe
bench_push_vec_small time: [52.762 ns 55.350 ns 58.252 ns]
change: [+14.773% +23.528% +31.631%] (p = 0.00 < 0.05)
Performance has regressed.
Found 4 outliers among 100 measurements (4.00%)
4 (4.00%) high mild
bench_insert_push_vec time: [404.35 ns 424.82 ns 448.83 ns]
change: [−2.5938% +1.7928% +6.5094%] (p = 0.44 > 0.05)
No change in performance detected.
Found 14 outliers among 100 measurements (14.00%)
1 (1.00%) high mild
13 (13.00%) high severe
bench_insert_push_vec_small
time: [65.307 ns 68.629 ns 72.565 ns]
change: [+9.2384% +16.265% +23.324%] (p = 0.00 < 0.05)
Performance has regressed.
Found 9 outliers among 100 measurements (9.00%)
9 (9.00%) high mild
bench_insert_vec time: [1.0005 µs 1.0573 µs 1.1241 µs]
change: [−11.208% −6.1268% −0.9881%] (p = 0.03 < 0.05)
Change within noise threshold.
Found 18 outliers among 100 measurements (18.00%)
3 (3.00%) high mild
15 (15.00%) high severe
bench_insert_vec_small time: [160.26 ns 168.76 ns 179.03 ns]
change: [+4.5919% +11.887% +19.336%] (p = 0.00 < 0.05)
Performance has regressed.
Found 17 outliers among 100 measurements (17.00%)
7 (7.00%) high mild
10 (10.00%) high severe
bench_remove_vec time: [848.44 ns 860.71 ns 872.70 ns]
change: [−5.5805% −0.0368% +3.7360%] (p = 0.99 > 0.05)
No change in performance detected.
Found 4 outliers among 100 measurements (4.00%)
2 (2.00%) high mild
2 (2.00%) high severe
bench_remove_vec_small time: [109.99 ns 111.33 ns 112.88 ns]
change: [−4.9061% −2.6910% −0.3158%] (p = 0.02 < 0.05)
Change within noise threshold.
Found 7 outliers among 100 measurements (7.00%)
2 (2.00%) high mild
5 (5.00%) high severe
bench_extend_vec time: [84.233 ns 85.857 ns 87.631 ns]
change: [−0.1957% +3.3132% +7.0606%] (p = 0.07 > 0.05)
No change in performance detected.
Found 7 outliers among 100 measurements (7.00%)
3 (3.00%) high mild
4 (4.00%) high severe
bench_extend_vec_small time: [42.692 ns 43.142 ns 43.627 ns]
change: [+8.0536% +11.642% +15.957%] (p = 0.00 < 0.05)
Performance has regressed.
Found 7 outliers among 100 measurements (7.00%)
2 (2.00%) high mild
5 (5.00%) high severe
bench_extend_vec_filtered
time: [163.17 ns 165.37 ns 167.84 ns]
change: [−6.9888% −3.3977% +0.2581%] (p = 0.08 > 0.05)
No change in performance detected.
Found 4 outliers among 100 measurements (4.00%)
2 (2.00%) high mild
2 (2.00%) high severe
bench_extend_vec_filtered_small
time: [43.545 ns 44.346 ns 45.358 ns]
change: [−4.6975% −0.4824% +3.6241%] (p = 0.83 > 0.05)
No change in performance detected.
Found 12 outliers among 100 measurements (12.00%)
4 (4.00%) high mild
8 (8.00%) high severe
bench_from_iter_vec time: [37.581 ns 38.286 ns 39.064 ns]
change: [+15.065% +17.607% +20.408%] (p = 0.00 < 0.05)
Performance has regressed.
Found 12 outliers among 100 measurements (12.00%)
8 (8.00%) high mild
4 (4.00%) high severe
bench_from_iter_vec_small
time: [28.363 ns 28.650 ns 28.959 ns]
change: [−10.900% −7.2276% −3.5177%] (p = 0.00 < 0.05)
Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
3 (3.00%) high mild
4 (4.00%) high severe
bench_from_slice_vec time: [35.317 ns 35.765 ns 36.364 ns]
change: [−14.756% −10.171% −5.1504%] (p = 0.00 < 0.05)
Performance has improved.
Found 12 outliers among 100 measurements (12.00%)
6 (6.00%) high mild
6 (6.00%) high severe
bench_from_slice_vec_small
time: [28.642 ns 29.118 ns 29.677 ns]
change: [−8.1138% −3.4616% +1.5445%] (p = 0.18 > 0.05)
No change in performance detected.
Found 9 outliers among 100 measurements (9.00%)
5 (5.00%) high mild
4 (4.00%) high severe
bench_extend_from_slice_vec
time: [82.693 ns 83.818 ns 85.198 ns]
change: [−17.157% −10.936% −4.4717%] (p = 0.00 < 0.05)
Performance has improved.
Found 11 outliers among 100 measurements (11.00%)
3 (3.00%) high mild
8 (8.00%) high severe
bench_extend_from_slice_vec_small
time: [42.694 ns 43.259 ns 43.918 ns]
change: [−20.777% −15.994% −11.015%] (p = 0.00 < 0.05)
Performance has improved.
Found 10 outliers among 100 measurements (10.00%)
4 (4.00%) high mild
6 (6.00%) high severe
bench_macro_from_elem_vec
time: [38.581 ns 38.907 ns 39.260 ns]
change: [−19.678% −14.208% −8.3224%] (p = 0.00 < 0.05)
Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
3 (3.00%) high mild
4 (4.00%) high severe
bench_macro_from_elem_vec_small
time: [30.110 ns 30.525 ns 30.976 ns]
change: [−17.246% −11.558% −5.5338%] (p = 0.00 < 0.05)
Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
3 (3.00%) high mild
3 (3.00%) high severe
bench_pushpop_vec time: [191.94 ns 194.44 ns 197.18 ns]
change: [−3.5217% +0.8918% +4.8338%] (p = 0.69 > 0.05)
No change in performance detected.
Found 8 outliers among 100 measurements (8.00%)
2 (2.00%) high mild
6 (6.00%) high severe
bench_retain_mut_vec_half
time: [55.709 ns 56.892 ns 58.384 ns]
change: [−17.401% −11.152% −4.4721%] (p = 0.00 < 0.05)
Performance has improved.
Found 14 outliers among 100 measurements (14.00%)
3 (3.00%) high mild
11 (11.00%) high severe
bench_retain_mut_vec_half_small
time: [31.386 ns 31.700 ns 32.053 ns]
change: [−12.324% −6.9943% −1.2128%] (p = 0.02 < 0.05)
Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
1 (1.00%) high mild
5 (5.00%) high severe
bench_retain_mut_vec_all
time: [27.260 ns 27.529 ns 27.826 ns]
change: [−2.2819% +1.7314% +6.0342%] (p = 0.42 > 0.05)
No change in performance detected.
Found 8 outliers among 100 measurements (8.00%)
3 (3.00%) high mild
5 (5.00%) high severe
bench_retain_mut_vec_all_small
time: [27.227 ns 27.474 ns 27.758 ns]
change: [+0.7643% +3.7827% +7.1699%] (p = 0.02 < 0.05)
Change within noise threshold.
Found 10 outliers among 100 measurements (10.00%)
3 (3.00%) high mild
7 (7.00%) high severe
bench_retain_mut_vec_none
time: [27.220 ns 27.472 ns 27.770 ns]
change: [−1.3583% +3.1953% +8.0772%] (p = 0.19 > 0.05)
No change in performance detected.
Found 8 outliers among 100 measurements (8.00%)
2 (2.00%) high mild
6 (6.00%) high severe
bench_retain_mut_vec_none_small
time: [27.142 ns 27.422 ns 27.767 ns]
change: [+2.7201% +8.3241% +14.309%] (p = 0.00 < 0.05)
Performance has regressed.
Found 13 outliers among 100 measurements (13.00%)
3 (3.00%) high mild
10 (10.00%) high severe
bench_macro_from_list time: [33.739 ns 34.047 ns 34.377 ns]
change: [−6.9564% −0.6994% +5.8752%] (p = 0.84 > 0.05)
No change in performance detected.
Found 14 outliers among 100 measurements (14.00%)
3 (3.00%) high mild
11 (11.00%) high severe
bench_macro_from_list_vec
time: [31.603 ns 31.993 ns 32.495 ns]
change: [−11.705% −7.2698% −3.1675%] (p = 0.00 < 0.05)
Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
3 (3.00%) high mild
6 (6.00%) high severe
|
@fereidani do you want to review it too?? |
|
I had my PR ready for other parts of the |
|
Oh I see you already suggested that. |
iamjaeholee
left a comment
There was a problem hiding this comment.
looks good
what do benchmarks say about performance??
Here are the benchmark results ! There are some good performance improvements.
Click here to see the full `cargo bench` output
Running benches\bench.rs (target\release\deps\bench-d74c7ed9f3c521cf.exe)
Gnuplot not found, using plotters backend
bench_push time: [373.37 ns 390.62 ns 409.13 ns]
change: [+4.1185% +12.803% +22.153%] (p = 0.00 < 0.05)
Performance has regressed.
Found 14 outliers among 100 measurements (14.00%)
11 (11.00%) high mild
3 (3.00%) high severe
bench_push_small time: [40.326 ns 42.371 ns 44.760 ns]
change: [−2.6925% +2.3787% +8.2721%] (p = 0.39 > 0.05)
No change in performance detected.
Found 16 outliers among 100 measurements (16.00%)
4 (4.00%) high mild
12 (12.00%) high severe
bench_insert_push time: [411.50 ns 429.36 ns 448.08 ns]
change: [−0.4463% +3.5913% +8.4293%] (p = 0.15 > 0.05)
No change in performance detected.
Found 6 outliers among 100 measurements (6.00%)
3 (3.00%) high mild
3 (3.00%) high severe
bench_insert_push_small time: [45.004 ns 47.651 ns 50.558 ns]
change: [+9.4360% +16.605% +25.199%] (p = 0.00 < 0.05)
Performance has regressed.
Found 16 outliers among 100 measurements (16.00%)
13 (13.00%) high mild
3 (3.00%) high severe
bench_insert time: [1.0701 µs 1.1200 µs 1.1777 µs]
change: [−4.5097% −0.2621% +4.2310%] (p = 0.91 > 0.05)
No change in performance detected.
Found 10 outliers among 100 measurements (10.00%)
2 (2.00%) high mild
8 (8.00%) high severe
bench_insert_small time: [145.96 ns 154.26 ns 163.80 ns]
change: [−3.4477% +2.0632% +8.0322%] (p = 0.48 > 0.05)
No change in performance detected.
Found 16 outliers among 100 measurements (16.00%)
3 (3.00%) high mild
13 (13.00%) high severe
bench_remove time: [864.93 ns 908.82 ns 958.52 ns]
change: [−12.923% −7.3011% −1.5552%] (p = 0.02 < 0.05)
Performance has improved.
Found 44 outliers among 100 measurements (44.00%)
22 (22.00%) low mild
4 (4.00%) high mild
18 (18.00%) high severe
bench_remove_small time: [124.17 ns 133.08 ns 143.03 ns]
change: [+6.8904% +12.218% +18.993%] (p = 0.00 < 0.05)
Performance has regressed.
Found 16 outliers among 100 measurements (16.00%)
9 (9.00%) high mild
7 (7.00%) high severe
bench_extend time: [54.699 ns 56.514 ns 58.869 ns]
change: [−3.4209% +3.7449% +10.831%] (p = 0.31 > 0.05)
No change in performance detected.
Found 20 outliers among 100 measurements (20.00%)
2 (2.00%) high mild
18 (18.00%) high severe
bench_extend_small time: [15.598 ns 16.394 ns 17.304 ns]
change: [−9.4453% −2.7595% +4.2134%] (p = 0.46 > 0.05)
No change in performance detected.
Found 8 outliers among 100 measurements (8.00%)
4 (4.00%) high mild
4 (4.00%) high severe
bench_extend_filtered time: [125.05 ns 132.05 ns 139.85 ns]
change: [−2.5446% +3.8771% +10.392%] (p = 0.26 > 0.05)
No change in performance detected.
Found 18 outliers among 100 measurements (18.00%)
7 (7.00%) high mild
11 (11.00%) high severe
bench_extend_filtered_small
time: [18.424 ns 19.549 ns 20.775 ns]
change: [−0.1823% +8.1630% +16.682%] (p = 0.05 < 0.05)
Change within noise threshold.
bench_from_iter time: [51.274 ns 53.702 ns 56.212 ns]
change: [−14.556% −8.8997% −3.1844%] (p = 0.00 < 0.05)
Performance has improved.
Found 24 outliers among 100 measurements (24.00%)
3 (3.00%) low mild
1 (1.00%) high mild
20 (20.00%) high severe
bench_from_iter_small time: [11.343 ns 11.649 ns 12.000 ns]
change: [−13.941% −10.777% −7.6690%] (p = 0.00 < 0.05)
Performance has improved.
Found 4 outliers among 100 measurements (4.00%)
3 (3.00%) high mild
1 (1.00%) high severe
bench_from_slice time: [48.712 ns 49.097 ns 49.512 ns]
change: [−16.857% −11.964% −7.0408%] (p = 0.00 < 0.05)
Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
6 (6.00%) high mild
1 (1.00%) high severe
bench_from_slice_small time: [12.499 ns 12.771 ns 13.062 ns]
change: [−9.5996% −5.6926% −1.7465%] (p = 0.01 < 0.05)
Performance has improved.
Found 4 outliers among 100 measurements (4.00%)
3 (3.00%) high mild
1 (1.00%) high severe
bench_extend_from_slice time: [56.389 ns 57.068 ns 57.806 ns]
change: [−3.6262% +0.7880% +5.6621%] (p = 0.74 > 0.05)
No change in performance detected.
Found 8 outliers among 100 measurements (8.00%)
2 (2.00%) high mild
6 (6.00%) high severe
bench_extend_from_slice_small
time: [14.949 ns 15.091 ns 15.238 ns]
change: [−13.785% −8.3108% −3.3143%] (p = 0.00 < 0.05)
Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
6 (6.00%) high mild
bench_macro_from_elem time: [66.872 ns 68.016 ns 69.452 ns]
change: [−7.7147% −3.9473% −0.1176%] (p = 0.05 < 0.05)
Change within noise threshold.
Found 7 outliers among 100 measurements (7.00%)
5 (5.00%) high mild
2 (2.00%) high severe
bench_macro_from_elem_small
time: [15.337 ns 15.606 ns 15.885 ns]
change: [−14.845% −9.5124% −4.0412%] (p = 0.00 < 0.05)
Performance has improved.
Found 16 outliers among 100 measurements (16.00%)
12 (12.00%) high mild
4 (4.00%) high severe
bench_pushpop time: [190.75 ns 192.93 ns 195.22 ns]
change: [−7.6763% −1.7385% +4.1538%] (p = 0.59 > 0.05)
No change in performance detected.
Found 5 outliers among 100 measurements (5.00%)
3 (3.00%) high mild
2 (2.00%) high severe
bench_retain_mut_half time: [60.573 ns 62.442 ns 65.016 ns]
change: [−0.6005% +6.0724% +12.977%] (p = 0.07 > 0.05)
No change in performance detected.
Found 9 outliers among 100 measurements (9.00%)
2 (2.00%) high mild
7 (7.00%) high severe
bench_retain_mut_half_small
time: [34.594 ns 35.220 ns 35.864 ns]
change: [−11.981% −8.3787% −4.8720%] (p = 0.00 < 0.05)
Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high severe
bench_retain_mut_all time: [27.687 ns 27.871 ns 28.067 ns]
change: [−21.640% −16.546% −11.084%] (p = 0.00 < 0.05)
Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
3 (3.00%) high mild
4 (4.00%) high severe
bench_retain_mut_all_small
time: [28.101 ns 28.390 ns 28.680 ns]
change: [−5.3196% −1.4063% +2.0339%] (p = 0.49 > 0.05)
No change in performance detected.
Found 4 outliers among 100 measurements (4.00%)
4 (4.00%) high mild
bench_retain_mut_none time: [28.091 ns 28.415 ns 28.788 ns]
change: [−19.647% −15.114% −10.246%] (p = 0.00 < 0.05)
Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
3 (3.00%) high mild
3 (3.00%) high severe
bench_retain_mut_none_small
time: [27.865 ns 28.070 ns 28.287 ns]
change: [−16.680% −11.805% −6.9065%] (p = 0.00 < 0.05)
Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
5 (5.00%) high mild
2 (2.00%) high severe
bench_push_vec time: [340.63 ns 347.78 ns 355.23 ns]
change: [−10.156% −4.7186% +0.9434%] (p = 0.12 > 0.05)
No change in performance detected.
Found 15 outliers among 100 measurements (15.00%)
11 (11.00%) low mild
4 (4.00%) high mild
bench_push_vec_small time: [49.678 ns 50.278 ns 50.953 ns]
change: [−79.335% −78.373% −77.407%] (p = 0.00 < 0.05)
Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
3 (3.00%) high mild
2 (2.00%) high severe
bench_insert_push_vec time: [396.59 ns 400.81 ns 405.39 ns]
change: [−7.9037% −2.4853% +3.1305%] (p = 0.39 > 0.05)
No change in performance detected.
Found 6 outliers among 100 measurements (6.00%)
2 (2.00%) high mild
4 (4.00%) high severe
bench_insert_push_vec_small
time: [59.694 ns 60.356 ns 61.128 ns]
change: [−5.5615% −1.7480% +1.9844%] (p = 0.40 > 0.05)
No change in performance detected.
Found 9 outliers among 100 measurements (9.00%)
5 (5.00%) high mild
4 (4.00%) high severe
bench_insert_vec time: [1.0982 µs 1.1067 µs 1.1157 µs]
change: [−11.015% −5.4933% +0.3251%] (p = 0.07 > 0.05)
No change in performance detected.
Found 5 outliers among 100 measurements (5.00%)
2 (2.00%) high mild
3 (3.00%) high severe
bench_insert_vec_small time: [156.92 ns 158.27 ns 159.78 ns]
change: [−15.789% −10.445% −4.9169%] (p = 0.00 < 0.05)
Performance has improved.
Found 14 outliers among 100 measurements (14.00%)
9 (9.00%) high mild
5 (5.00%) high severe
bench_remove_vec time: [807.93 ns 818.61 ns 831.50 ns]
change: [−19.371% −12.874% −5.3471%] (p = 0.00 < 0.05)
Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
2 (2.00%) high mild
1 (1.00%) high severe
bench_remove_vec_small time: [113.09 ns 114.20 ns 115.40 ns]
change: [−13.226% −8.2187% −3.1810%] (p = 0.00 < 0.05)
Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
5 (5.00%) high mild
2 (2.00%) high severe
bench_extend_vec time: [79.849 ns 80.869 ns 82.082 ns]
change: [−21.697% −16.701% −11.389%] (p = 0.00 < 0.05)
Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
3 (3.00%) high mild
2 (2.00%) high severe
bench_extend_vec_small time: [38.924 ns 39.818 ns 41.192 ns]
change: [−27.310% −22.941% −18.384%] (p = 0.00 < 0.05)
Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
4 (4.00%) high mild
3 (3.00%) high severe
bench_extend_vec_filtered
time: [164.80 ns 170.58 ns 177.67 ns]
change: [−10.823% −4.8014% +1.6186%] (p = 0.15 > 0.05)
No change in performance detected.
Found 14 outliers among 100 measurements (14.00%)
1 (1.00%) high mild
13 (13.00%) high severe
bench_extend_vec_filtered_small
time: [44.182 ns 45.230 ns 46.539 ns]
change: [−12.480% −7.0034% −1.6136%] (p = 0.02 < 0.05)
Performance has improved.
Found 14 outliers among 100 measurements (14.00%)
3 (3.00%) high mild
11 (11.00%) high severe
bench_from_iter_vec time: [32.212 ns 32.592 ns 32.994 ns]
change: [−24.827% −19.689% −14.569%] (p = 0.00 < 0.05)
Performance has improved.
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
bench_from_iter_vec_small
time: [29.327 ns 30.873 ns 32.694 ns]
change: [−18.890% −13.146% −7.0786%] (p = 0.00 < 0.05)
Performance has improved.
Found 21 outliers among 100 measurements (21.00%)
10 (10.00%) high mild
11 (11.00%) high severe
bench_from_slice_vec time: [36.285 ns 38.499 ns 41.102 ns]
change: [−10.614% −3.1944% +4.7460%] (p = 0.41 > 0.05)
No change in performance detected.
Found 18 outliers among 100 measurements (18.00%)
7 (7.00%) high mild
11 (11.00%) high severe
bench_from_slice_vec_small
time: [30.259 ns 32.180 ns 34.376 ns]
change: [−7.2607% −1.5764% +3.9862%] (p = 0.60 > 0.05)
No change in performance detected.
Found 14 outliers among 100 measurements (14.00%)
2 (2.00%) high mild
12 (12.00%) high severe
bench_extend_from_slice_vec
time: [84.203 ns 88.065 ns 93.350 ns]
change: [−67.296% −64.792% −62.161%] (p = 0.00 < 0.05)
Performance has improved.
Found 21 outliers among 100 measurements (21.00%)
2 (2.00%) high mild
19 (19.00%) high severe
bench_extend_from_slice_vec_small
time: [47.828 ns 50.054 ns 52.624 ns]
change: [+4.9357% +12.437% +20.554%] (p = 0.00 < 0.05)
Performance has regressed.
Found 23 outliers among 100 measurements (23.00%)
2 (2.00%) high mild
21 (21.00%) high severe
bench_macro_from_elem_vec
time: [42.504 ns 45.099 ns 48.106 ns]
change: [−1.6667% +6.2803% +14.856%] (p = 0.12 > 0.05)
No change in performance detected.
Found 12 outliers among 100 measurements (12.00%)
10 (10.00%) high mild
2 (2.00%) high severe
bench_macro_from_elem_vec_small
time: [30.793 ns 32.098 ns 33.659 ns]
change: [−5.2549% +3.2656% +12.213%] (p = 0.47 > 0.05)
No change in performance detected.
Found 23 outliers among 100 measurements (23.00%)
23 (23.00%) high severe
bench_pushpop_vec time: [182.28 ns 190.45 ns 200.32 ns]
change: [−19.443% −13.954% −8.0526%] (p = 0.00 < 0.05)
Performance has improved.
Found 10 outliers among 100 measurements (10.00%)
3 (3.00%) high mild
7 (7.00%) high severe
bench_retain_mut_vec_half
time: [58.219 ns 61.851 ns 66.263 ns]
change: [−7.1049% +1.4920% +11.068%] (p = 0.75 > 0.05)
No change in performance detected.
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
bench_retain_mut_vec_half_small
time: [32.064 ns 33.693 ns 35.612 ns]
change: [+0.7874% +6.7619% +13.243%] (p = 0.04 < 0.05)
Change within noise threshold.
Found 23 outliers among 100 measurements (23.00%)
4 (4.00%) high mild
19 (19.00%) high severe
bench_retain_mut_vec_all
time: [26.912 ns 27.051 ns 27.214 ns]
change: [−23.703% −18.534% −12.716%] (p = 0.00 < 0.05)
Performance has improved.
Found 12 outliers among 100 measurements (12.00%)
4 (4.00%) high mild
8 (8.00%) high severe
bench_retain_mut_vec_all_small
time: [26.889 ns 27.005 ns 27.148 ns]
change: [−23.824% −19.093% −14.067%] (p = 0.00 < 0.05)
Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
2 (2.00%) high mild
7 (7.00%) high severe
bench_retain_mut_vec_none
time: [26.998 ns 27.080 ns 27.177 ns]
change: [−14.872% −9.8800% −4.7152%] (p = 0.00 < 0.05)
Performance has improved.
Found 8 outliers among 100 measurements (8.00%)
1 (1.00%) high mild
7 (7.00%) high severe
bench_retain_mut_vec_none_small
time: [24.676 ns 24.935 ns 25.273 ns]
change: [−22.237% −16.773% −11.141%] (p = 0.00 < 0.05)
Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
2 (2.00%) high mild
4 (4.00%) high severe
bench_macro_from_list time: [32.049 ns 33.192 ns 34.584 ns]
change: [−3.7019% +3.0737% +9.5938%] (p = 0.39 > 0.05)
No change in performance detected.
Found 19 outliers among 100 measurements (19.00%)
2 (2.00%) high mild
17 (17.00%) high severe
bench_macro_from_list_vec
time: [32.796 ns 33.538 ns 34.606 ns]
change: [−16.044% −9.7563% −2.3128%] (p = 0.01 < 0.05)
Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
9 (9.00%) high severe
iamjaeholee
left a comment
There was a problem hiding this comment.
also, can increment/decrement simply be removed and replaced for
addandsubwherever it's used and performance would still be the same?? that'd be much simpler
Sure i will make a changes and test it out.
Fixes #570.
Hi! I made the changes requested in #570.
What I did:
add(n: usize)andsub(n: usize)methods toTaggedLen. It usesn << 1to keep the heap flag safe.increment()anddecrement()to just calladd(1)andsub(1).set_len(current_len + n)withself.len.add(n)insrc/lib.rs.All tests pass. Please check it!