bloom2/
lib.rs

1//! bloom2 implements a 2-level bitmap to provide a sparse, lazily initialised,
2//! high performance bloom filter with a reduced memory footprint.
3//!
4//! The memory usage of a sparse bloom filter grows proportionally with the load
5//! factor of the filter, resulting in substantially smaller memory footprints
6//! for filters with average, or low load factors. As bloom filters are
7//! typically sized to avoid high load factors in order to minimise false
8//! positives, this is highly effective for the typical use case.
9//!
10//! The [`Bloom2`] filter provides amortised `O(1)` insert, and constant time
11//! `O(1)` lookup with a similar average case latency compared to a standard
12//! bloom filter (~30ns on a Core i7 @ 2.60GHz, with a majority of this taken up
13//! by the hashing of values).
14//!
15//! The sparse memory behaviour is implemented in the underlying
16//! [`CompressedBitmap`], which is used as the bit storage for the filter. The
17//! `CompressedBitmap` is a fast (~4ns set, 1ns get) space efficient
18//! general-purpose bitmap suitable for use in applications in addition to the
19//! bloom filter.
20//!
21//! ## Features
22//!
23//! * `serde` - enable serialisation with [serde], disabled by default
24//!
25//! [serde]: https://github.com/serde-rs/serde
26//! [`Bloom2`]: crate::Bloom2
27//! [`CompressedBitmap`]: crate::bitmap::CompressedBitmap
28
29mod bitmap;
30pub use bitmap::*;
31
32mod bloom;
33pub use bloom::*;
34
35mod filter_size;
36pub use filter_size::*;