Crate atomic_hyperloglog
source ·Expand description
Atomic HyperLogLog
a concurrent, super fast, pretty-well-tested and fully safe hyperloglog for rust with no dependencies.
use atomic_hyperloglog::HyperLogLog;
let h = HyperLogLog::new(BuildHasherDefault::<SeaHasher>::default(), 12);
for n in 0..10_000 {
h.add(n);
}
let est = h.cardinality();
assert!(10_000.0 * 0.95 <= est && est <= 10_000.0 * 1.05, "{est}");
Structs
- A hyperloglog data structure, allowing count-distinct with limited memory overhead. Fully concurrent with relaxed-only ordering and zero-unsafe code.