mixxx
mixxx copied to clipboard
Refactor: `MovingInterquartileMean`
what was initially just supposed to be a cleanup/refactor, mutated into a full blown optimization. This is primarily intended as a cleanup though, and I only implemented the benchmark to show that this was not causing regressions in performance. There is still a little more to be done, but these are some preliminary numbers. Before:
-----------------------------------------------------------------------------
Benchmark Time CPU Iterations UserCounters...
-----------------------------------------------------------------------------
BM_insertion/16 17485 ns 16857 ns 1 items_per_second=3.79664M/s
BM_insertion/64 20922 ns 20926 ns 1 items_per_second=12.2336M/s
BM_insertion/512 774264 ns 770344 ns 1 items_per_second=2.65855M/s
BM_insertion/4096 55161004 ns 54684805 ns 1 items_per_second=299.608k/s
BM_insertion/16384 891138337 ns 886767771 ns 1 items_per_second=73.9044k/s
After:
-----------------------------------------------------------------------------
Benchmark Time CPU Iterations UserCounters...
-----------------------------------------------------------------------------
BM_insertion/16 10458 ns 9738 ns 1 items_per_second=6.57219M/s
BM_insertion/64 16030 ns 15969 ns 1 items_per_second=16.0311M/s
BM_insertion/512 745585 ns 735096 ns 1 items_per_second=2.78603M/s
BM_insertion/4096 40907286 ns 40517411 ns 1 items_per_second=404.369k/s
BM_insertion/16384 644210901 ns 641245320 ns 1 items_per_second=102.201k/s