hyperloglogplus

Crates.iohyperloglogplus
lib.rshyperloglogplus
version0.4.1
sourcesrc
created_at2020-04-16 05:58:51.671048
updated_at2022-06-13 21:27:48.162753
descriptionHyperLogLog implementations.
homepagehttps://github.com/tabac/hyperloglog.rs
repositoryhttps://github.com/tabac/hyperloglog.rs
max_upload_size
id230689
size188,503
Anastasios Bakogiannis (tabac)

documentation

https://docs.rs/hyperloglogplus

README

HyperLogLog

Build status Crates.io Documentation

HyperLogLog is a probabilistic algorithm for estimating the number of distinct elements (cardinality) of a multiset. Several variations of the original algorithm, described by P. Flajolet et al., have been proposed.

The following implementations are provided:

Usage

Add to Cargo.toml:

[dependencies]
hyperloglogplus = "*"

With Rust compiler version 1.45.0 or higher consider enabling the const-loop feature for better performance, see here for more details.

[dependencies]
hyperloglogplus = { version = "*", features = ["const-loop"] }

A simple example using HyperLogLog++ implementation:

use std::collections::hash_map::RandomState;
use hyperloglogplus::{HyperLogLog, HyperLogLogPlus};

let mut hllp: HyperLogLogPlus<u32, _> =
    HyperLogLogPlus::new(16, RandomState::new()).unwrap();

hllp.insert(&12345);
hllp.insert(&23456);

assert_eq!(hllp.count().trunc() as u32, 2);

Evaluation

Here you can find figures and discussion on experimental evaluation.

Commit count: 42

cargo fmt