apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Branko ─îibej <br...@apache.org>
Subject Re: svn commit: r1237078 - /apr/apr/trunk/tables/apr_hash.c
Date Mon, 30 Jan 2012 01:08:19 GMT
On 30.01.2012 00:15, Bojan Smojver wrote:
> On Mon, 2012-01-30 at 09:59 +1100, Bojan Smojver wrote:
>> With my latest patch, I get that fixed (i.e. the final hash is
>> perturbed a lot better).
> Hmm, different problems emerge. The hash then has a tendency to produce
> either all odd or even indexes (i.e. lower bits used to address
> buckets).

Just as I said -- the hash function we have is not meant to be perfect,
or even secure, but to allow reasonable insertion and retrieval times.
Running the same result through it again will not make any appreciabble
difference. to the distribution.

You'd have to make the second pass with a different hash function, or at
least a different prime multiplier. I'm still not sure that'd be worth
the extra cycles, however. I'm not even close to being an expert on
hashing functions, but all multiply/modulo hashes apparently tend to
behave similarly.

-- Brane

View raw message