Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve CKMS performance (postmates#21)
* Introduce criterion benchmarks for CKMS This commit introduces the [criterion](https://github.com/japaric/criterion.rs) library into quantiles. The intention is to tackle CKMS performance again. Signed-off-by: Brian L. Troutwine <[email protected]> * Fiddle some with the performance characteristics This commit cuts the size of Entry a by 64 bits, shaving milliseconds off the 10k benchmark run. We're still waaaay too slow for 65k to really notice a good difference there. Signed-off-by: Brian L. Troutwine <[email protected]> * Finish adding documentation for the night Time to wrap it up. I'll have to shop this around to folks that have a better handle on wacky tricks and/or know of a DS of greater applicability than Vec. I am stuck for sure. Signed-off-by: Brian L. Troutwine <[email protected]> * Introduce 'Store' This commit is inspired by the discussion [here](https://users.rust-lang.org/t/how-can-i-optimize-this-data-structure/14273/7). I'm not sure yet how well it does, benchmark wise. Signed-off-by: Brian L. Troutwine <[email protected]> * Bookmark commit In this commit we're set to run comparative benchmarks for Vec and Store. The results were not promising, with Vec mean being 493ms and Store mean being 546. Better SD and MAD on Vec too. The computation of 'r' can be stored at the top of each inner store and we can keep a sorted buffer for insertion. I guess the thing to do is benchmark Vec against Store, see where we end up. Signed-off-by: Brian L. Troutwine <[email protected]> * Go all-in on Store, perform compaction of inner data This commit moves CKMS fully onto store with the understanding that the current implementation is pokier than just plain Vec on account of iteration on insertion. The expectation is that we can resolve this. Benchmarking -- not shown -- indicates that Store can do inserts about twice as fast as Vec _if_ we don't have to seek over the whole thing before inserting. Signed-off-by: Brian L. Troutwine <[email protected]> * WIP commit This commit goes quite a ways toward making 'stores' a proper backing store for CKMS. We just need AddAssign going again. Signed-off-by: Brian L. Troutwine <[email protected]> * Re-introduce AddAssign to CKMS Signed-off-by: Brian L. Troutwine <[email protected]> * Better footing for benchmarks I've removed sum from the interface of CKMS because if the type is especially small I don't have a wrapping_add available to me. Oops. Up to the client to keep track of this, as a result. Well, maybe if I look into Wrapping? Anyway! We're now on a good footing to benchmark this thing. Signed-off-by: Brian L. Troutwine <[email protected]> * Switch benchmark back to 65k. Signed-off-by: Brian L. Troutwine <[email protected]> * Correct benchmarking I've backed off the use of criterion for now since I couldn't figure out how to slot it into our existing macro-based benchmark generation. This _should_ now pass CI. Signed-off-by: Brian L. Troutwine <[email protected]> * Introduce comments to store.rs, fuzz tests This commit adds the last bit of polish to store.rs in terms of commenting on its function. We also introduce fuzz tests for inspecting the CKMS implementation. -max_len=160 ought to be in place for the existing fuzz test. Signed-off-by: Brian L. Troutwine <[email protected]>
- Loading branch information