Hacker News new | ask | show | jobs
by senderista 42 days ago
You are describing "blocked" bloom filters here (i.e., the k hash functions are evaluated in a single block which is initially chosen by the hash). "Partitioned" bloom filters (i.e., each hash function is evaluated in a separate partition) don't have the imbalance problem you describe.
1 comments

I'm describing the data structure from the article, which is partitioned twice: first into 64-byte, then into pairwise coprime-sized chunks. The 64-byte chunks are what you're quoting as "blocked", the pairwise coprime-sized chunks as "partitioned". The space inefficiency I mentioned applies to the 64-byte chunks.
You can mitigate this imbalance (at the expense of more cache misses) in the usual way by applying the power of 2 choices:

https://lph.ece.utexas.edu/users/krimer/pub/im11_bf.pdf

More cache misses, and also an increased false positive rate from doing multiple lookups. A similarly optimized cuckoo filter (cache line-sized buckets/windows and SIMD queries) is both smaller and faster.