streaming_algorithms

Crates.iostreaming_algorithms
lib.rsstreaming_algorithms
version0.3.0
sourcesrc
created_at2018-09-19 13:51:09.095187
updated_at2020-07-15 10:29:25.040731
descriptionSIMD-accelerated implementations of various streaming algorithms, including Count–min sketch, Top k, HyperLogLog, Reservoir sampling.
homepagehttps://github.com/alecmocatta/streaming_algorithms
repositoryhttps://github.com/alecmocatta/streaming_algorithms
max_upload_size
id85489
size162,897
Alec Mocatta (alecmocatta)

documentation

https://docs.rs/streaming_algorithms

README

streaming_algorithms

Crates.io MIT / Apache 2.0 licensed Build Status

đŸ“– Docs | đŸ’¬ Chat

SIMD-accelerated implementations of various streaming algorithms.

This library is a work in progress. PRs are very welcome! Currently implemented algorithms include:

  • Count–min sketch
  • Top k (Count–min sketch plus a doubly linked hashmap to track heavy hitters / top k keys when ordered by aggregated value)
  • HyperLogLog
  • Reservoir sampling

A goal of this library is to enable composition of these algorithms; for example Top k + HyperLogLog to enable an approximate version of something akin to SELECT key FROM table GROUP BY key ORDER BY COUNT(DISTINCT value) DESC LIMIT k.

Run your application with RUSTFLAGS="-C target-cpu=native" and the nightly feature to benefit from the SIMD-acceleration like so:

RUSTFLAGS="-C target-cpu=native" cargo run --features "streaming_algorithms/nightly" --release

See this gist for a good list of further algorithms to be implemented. Other resources are Probabilistic data structures – Wikipedia, DataSketches – A similar Java library originating at Yahoo, and Algebird – A similar Java library originating at Twitter.

As these implementations are often in hot code paths, unsafe is used, albeit only when necessary to a) achieve the asymptotically optimal algorithm or b) mitigate an observed bottleneck.

License

Licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 47

cargo fmt