Constant style::bloom::MEMSET_CLEAR_THRESHOLD

source ยท
const MEMSET_CLEAR_THRESHOLD: usize = 25;
Expand description

The very rough benchmarks in the selectors crate show clear() costing about 25 times more than remove_hash(). We use this to implement clear() more efficiently when only a small number of hashes have been pushed.

One subtly to note is that remove_hash() will not touch the value if the filter overflowed. However, overflow can only occur if we get 255 collisions on the same hash value, and 25 < 255.