Struct dsrs::CpcSketch [−][src]
pub struct CpcSketch { /* fields omitted */ }
Expand description
The Compressed Probability Counting (CPC) sketch is a dynamically resizing (but still bounded-size) distinct count sketch. Some differences between CPC and the more typical HLL++ are:
- CPC theoretically uses less space than HLL (HLL++ does not asymptotically improve over HLL).
- CPC allocates, whereas certain HLL implementations may not.
To give you a sense of CPC performance, the linked benchmarks show CPC requiring only 2.5KB of space for recovering a billion distinct values well within 5% relative error even in the 99-th percentile.
This sketch supports merging through an intermediate type, CpcUnion
.
Implementations
Observe a new value. Two values must have the exact same bytes and lengths to be considered equal.
Observe a new u64
. If the native-endian byte ordered bytes
are equal to any other value seen by update()
, this will be considered
equal. If you are intending to use serialized sketches across
platforms with different endianness, make sure to convert this
value
to network order first.