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

Create a CPC sketch representing the empty set.

Return the current estimate of distinct values seen.

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.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.