Flow ID, LACP, and igb

Luigi Rizzo rizzo at iet.unipi.it
Sat Aug 31 00:05:03 UTC 2013


Alan,


On Thu, Aug 29, 2013 at 6:45 PM, Alan Somers <asomers at freebsd.org> wrote:
>
>
> ...
> I pulled all four hash functions out into userland and microbenchmarked
> them.  The upshot is that hash32 and fnv_hash are the fastest, jenkins_hash
> is slower, and siphash24 is the slowest.  Also, Clang resulted in much
> faster code than gcc.
>
>
i missed this part of your message, but if i read your code well,
you are running 100M iterations and the numbers below are in seconds,
so if you multiply the numbers by 10 you have the cost per hash in
nanoseconds.

What CPU did you use for your tests ?

Also some of the numbers (FNV and hash32) are suspiciously low.

I believe that the compiler (both of them) have figure out that everything
is constant in these functions, and fnv_32_buf() and hash32_buf() are
inline,
hence they can be optimized to just return a constant.
This does not happen for siphash and jenkins because they are defined
externally.

Can you please re-run the tests in a way that defeats the optimization ?
(e.g. pass a non constant argument to the the hashes so you actually need
to run the code).

cheers
luigi


http://people.freebsd.org/~asomers/lagg_hash/
>
> [root at sm4u-4 /usr/home/alans/ctest/lagg_hash]# ./lagg_hash-gcc-4.8
> FNV: 0.76
> hash32: 1.18
> SipHash24: 44.39
> Jenkins: 6.20
> [root at sm4u-4 /usr/home/alans/ctest/lagg_hash]# ./lagg_hash-gcc-4.2.1
> FNV: 0.74
> hash32: 1.35
> SipHash24: 55.25
> Jenkins: 7.37
> [root at sm4u-4 /usr/home/alans/ctest/lagg_hash]# ./lagg_hash.clang-3.3
> FNV: 0.30
> hash32: 0.30
> SipHash24: 55.97
> Jenkins: 6.45
> [root at sm4u-4 /usr/home/alans/ctest/lagg_hash]# ./lagg_hash.clang-3.2
> FNV: 0.30
> hash32: 0.30
> SipHash24: 44.52
> Jenkins: 6.48
>
>
>
> > T.C.
> >
> > [1]
> >
> http://svnweb.freebsd.org/base/head/sys/libkern/jenkins_hash.c?view=markup
> _______________________________________________
> freebsd-net at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"
>


More information about the freebsd-net mailing list