lkml.org 
[lkml]   [2016]   [May]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 2/7] lib/hashmod: Add modulo based hash mechanism
On Sat, 30 Apr 2016, George Spelvin wrote:
> Thomas Gleixner wrote:
> You say that
> > hash64 is slightly faster as the modulo prime as it does not have the
> > multiplication.
>
> Um... are you sure you benchmarked that right? The hash_64 code you
> used (Thomas Wang's 64->32-bit hash) has a critical path consisting of 6
> shifts and 7 adds. I can't believe that's faster than a single multiply.

Sorry I did not express myself clear enough.

hash64 (the single multiply with the adjusted golden ratio) is slightly faster
than the modulo one which has two mutiplications.

So here is the list:

hash_64(): (key * GOLDEN_RATIO) >> (64 - bits) 31Mio Ops/sec

modulo: 28Mio Ops/sec

Thomas Wangs 64 -> 32 bit 21Mio Ops/sec

Thanks,

tglx

\
 
 \ /
  Last update: 2016-05-01 11:01    [W:0.087 / U:1.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site