Make bloom filter more effective. by dbaarda · Pull Request #193 · librsync/librsync

added 3 commits

April 30, 2020 10:05
Mix the hash's upper 16bits with the lower 16bits as a different hash for the
bloom filter. This means bloomfilter hits don't necessarily align with
occupied hashtable entries, possibly avoiding multiple hashtable probes to
detect a hashtable miss.
Add and use tmask attribute for getting the hashtable index from a hash.

Add and use bshift attribute for getting the bloomfilter bit index from a
hash. This means we use the upper bits of the hash instead of bit-mixing and
masking.
For a minimum of 1 and an empty file, the mask is empty, resulting in a bshift
with as many bits as unsigned hash. In C shifting by all the bits is
undefined.