Skip to content

Conversation

@fereidani
Copy link

Hey,
I did some improvements for the library.

What’s in here:

  • Switched the benchmarks over to Criterion and used black_box for correct more accurate benchmark and added retain_mut benches so the Vector trait is fully covered now.
  • Made the tests less time consuming when running under Miri.
  • Reworked retain_mut, reserve/reserve_exact, and pop. They’re cleaner now and faster.
  • Added a fmt check to CI to keep the library formatted.

here is the benchmark result for retain function:

bench_retain_mut_half   time:   [76.825 ns 76.946 ns 77.077 ns]
                        change: [−15.591% −15.307% −15.010%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
  4 (4.00%) high mild
  5 (5.00%) high severe

bench_retain_mut_half_small
                        time:   [17.323 ns 17.376 ns 17.434 ns]
                        change: [−5.3509% −4.9664% −4.5552%] (p = 0.00 < 0.05)
                        Performance has improved.

bench_retain_mut_all    time:   [26.311 ns 26.383 ns 26.457 ns]
                        change: [−2.3774% −1.9115% −1.4710%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 4 outliers among 100 measurements (4.00%)
  1 (1.00%) low mild
  2 (2.00%) high mild
  1 (1.00%) high severe

bench_retain_mut_all_small
                        time:   [17.984 ns 18.211 ns 18.453 ns]
                        change: [+0.7628% +2.1217% +3.4929%] (p = 0.00 < 0.05)
                        Change within noise threshold.

bench_retain_mut_none   time:   [25.847 ns 25.917 ns 25.994 ns]
                        change: [−1.2565% −0.3335% +0.5576%] (p = 0.48 > 0.05)
                        No change in performance detected.
Found 11 outliers among 100 measurements (11.00%)
  11 (11.00%) high severe

bench_retain_mut_none_small
                        time:   [12.992 ns 13.038 ns 13.088 ns]
                        change: [−0.0966% +0.7096% +1.4743%] (p = 0.08 > 0.05)
                        No change in performance detected.
Found 10 outliers among 100 measurements (10.00%)
  5 (5.00%) high mild
  5 (5.00%) high severe

Thanks you for maintaining this library.

@fereidani
Copy link
Author

Forgot to add that rework of reserve is based on std implementation of reserve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant