hypeerlog
A fast, distributable, and lightweight HyperLogLog implementation with bias correction
Usage
Estimating cardinality
use Hypeerlog;
let elems = vec!;
let mut hll = new;
hll.insert_many;
// Should be within 1% of the real cardinality
hll.cardinality;
Distributing the work
You can divide the dataset onto multiple computers, dump the hll when you finish adding the data, load the dump into another computer, merge all the hll, and then calculate the cardinality of the merged hll to get the cardinality for the whole dataset:
use Hypeerlog;
let elems = vec!;
let mut hll_one = new;
hll_one.insert_many;
let mut hll_two = new;
hll_two.insert_many;
hll_one.merge.unwrap.cardinality;
Contribution
Feel free to fork or do a pull request, but it is highly advised to read the Google paper before looking into the code in order to understand the internals