Skip to main content

Module bloom_filter

Module bloom_filter 

Source
Expand description

Bloom filter for probabilistic cache membership testing.

Provides two filter variants:

  • BloomFilter — classic bit-array Bloom filter with optimal m and k computed from expected item count and desired false-positive rate.
  • CountingBloomFilter — extends the bit filter with 4-bit saturating counters so that individual items can be removed.

Both use a pure-Rust FNV-1a double-hashing scheme; no external crates are required.

§Wave 13 additions

  • hash_batch_fnv1a — vectorized FNV-1a across a batch of keys. Uses AVX2 on x86-64 (8 lanes), NEON on aarch64, and scalar fallback elsewhere. The vectorization is across keys (not within one key), so throughput scales with the number of items in the batch.

Structs§

BloomFilter
Space-efficient probabilistic membership filter.
CountingBloomFilter
Bloom filter with 4-bit saturating counters that supports deletion.
ScalableBloomFilter
Auto-growing Bloom filter that adds new layers when the estimated false-positive rate of the current layer exceeds a threshold.

Functions§

hash_batch_fnv1a
Hash a batch of keys with FNV-1a, vectorizing ACROSS keys.