[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091026104532.5c30c6b9@nehalam>
Date: Mon, 26 Oct 2009 10:45:32 -0700
From: Stephen Hemminger <shemminger@...tta.com>
To: Stephen Hemminger <shemminger@...tta.com>
Cc: Octavian Purdila <opurdila@...acom.com>,
Eric Dumazet <eric.dumazet@...il.com>,
Krishna Kumar2 <krkumar2@...ibm.com>,
Hagen Paul Pfeifer <hagen@...u.net>, netdev@...r.kernel.org
Subject: Re: [PATCH next-next-2.6] netdev: better dev_name_hash
Another algorithm that scores well in my tests.
http://isthe.com/chongo/tech/comp/fnv/
Algorithm Time Ratio Max StdDev
string10 1.433267 1.00 39064 0.01
string_hash17 1.461422 1.00 39497 1.50
fnv1a 1.472216 1.00 39895 2.25
jhash_string 1.482494 1.00 39669 1.04
static unsigned int fnv32(const unsigned char *key, unsigned int len)
{
uint32_t hval = 2166136261;
unsigned int i;
for (i = 0; i < len; i++) {
hval ^= key[i];
/* optimized multiply by 0x01000193 */
hval += (hval<<1) + (hval<<4) + (hval<<7)
+ (hval<<8) + (hval<<24);
}
return hval;
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists