Dynamic hash table size (with static has load)

Wayne Davison wayned at samba.org
Sat Feb 25 18:10:37 GMT 2006


On Sat, Feb 25, 2006 at 01:25:52PM +0200, Shachar Shemesh wrote:
> Attached is a patch that uses a non-predetermined hash table size, so
> that the hash cell load (alpha) is never more than 80%.

Thanks for the patch!  Here's some comments:

 - You didn't change the size of the "tag" typedef (an unsigned short),
   and your patch makes the value potentially overflow.

 - For smaller hash-table sizes, your algorithm does a lookup in the
   table based only on the s1 value (due to the (s2 << 16) value being
   too large to have any remainder less than the tablesize).

So, I think this probably needs to leave gettag() calling gettag2(), and
change gettag2() to factor both s1 and s2 into some kind of an improved
tag-generating computation.

..wayne..


More information about the rsync mailing list