httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: [PATCH] simple hash table implementation
Date Sat, 06 May 2000 02:14:12 GMT
On Thu, 4 May 2000, Tony Finch wrote:
> Jeff Trawick <trawickj@bellsouth.net> wrote:
> >Thanks!  I'm looking forward to using it as the basis for an
> >optional cache of APR character set translation stuff...
> 
> I just remembered that I was going to add an
> 	if (klen == 0)
> 		klen = strlen(key) + 1;
> to find_entry() before committing, and I was thinking about Greg's
> suggestions, hence the delay...

Guess I should respond to the alternate hashing problem then, eh? :-)

If I have explicit information about the domain of my keys, then I can
construct a much better hash than the provided hash. For example, if I
know the keys are 16-bit integers in the range [0,32767], then my input
hash function will be the identity function (faster).

If the keys are pathnames, then I might want to hash on just the last 10
characters, on the assumption that is where the significant differences
are.

In truth, I'm only +0 on adding custom hash functions (most of the custom
hashing is really for speed rather than creating a more uniform
distribution). If/when a need *actually* arises, then we can go back in
there and add the functions.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/


Mime
View raw message