Skip to content

Latest commit

 

History

History
62 lines (41 loc) · 1.71 KB

File metadata and controls

62 lines (41 loc) · 1.71 KB

probfilter

Warning

Work in progress.

Probabilistic filters data structures in Rust.

What's inside

  • Standard Bloom filter - classic flat bit array with double hashing
  • Blocked Bloom filter - 512-bit blocks, multiplicative remix probing (follows RocksDB's FastLocalBloomImpl)
  • Register-blocked Bloom filter — 64-bit word-sized blocks with mask-based insert/query
  • Prefix Bloom filter - fixed-length prefix extractor over a blocked filter

Planned

  • Diva range filter
  • Serialization

Usage

use probfilter::bloom::standard::StandardBloomFilter;
use probfilter::traits::{PointFilter, FilterInsert};

let mut filter = StandardBloomFilter::new(10_000, 0.01);
filter.insert(b"hello");
assert!(filter.may_contain(b"hello"));

Tests

cargo test

Benchmarks

cargo bench --bench bloom

Filter to a specific group:

cargo bench --bench bloom -- bloom_lookup
cargo bench --bench bloom -- bloom_insert

Results are saved to target/criterion/ with HTML reports.

References

License

MIT