Subject: Re: New hash algorithm - FNV - for use in the kernel
To: None <,>
From: Thor Lancelot Simon <>
List: tech-kern
Date: 11/28/2001 13:55:34
On Wed, Nov 28, 2001 at 11:26:45AM -0500, Todd Vierling wrote:
> On Wed, 28 Nov 2001, Herb Peyerl wrote:
> :  > ...and you'll drive away the retrocomputing geeks in droves.  One of
> :  > NetBSD's greatest strengths is that it runs on an immense spectrum of
> :  > machines from sub-1MIP VAXen and Sun-2s through bleeding-edge killer
> :  > desktops.  Do you really want to lose that low end?
> :
> : This is a terrific point, however, I don't think we want to gain a
> : reputation of "NetBSD is great if you want to run old hw, but it's
> : at the expense of serious performance optimizations on newer hw
> : so you're better off to run <insert other OS here>"...
> Shouldn't it be possible to have more than one hashing algorithm available
> for indexing the kernel's hashtables?  There are CPP conditionals that could
> be used for this purpose.  <wide grin>

I have a concrete proposal.  Let's define, somewhere in a MD header file,
"string_hash(x)" and "binary_hash(x)" for each machine architecture.  At
worst, to the name of a function, but no matter what *not* to an actual
function pointer; maybe just to the actual inline expansion of the hash

We won't have to lose any performance on the slow ports, and we can gain
some on the fast ones.  We will probably even gain some on the slow ports
if we carefully choose the hash functions we use.