
MurmurHash 2.0 - kqr2
http://murmurhash.googlepages.com/
======
markessien
I VERY much dislike such webpages where there is no information what it is.
Stop assuming some knowledge and start of the webpage with a two line
description of what the project is.

~~~
vomjom
The name of the project tells you what it does. If you don't understand from
the name of the project, you'll certainly have no use for it.

~~~
thras
It's a hash container, right? I do have a use for it, but it took some serious
investigation to find out anything about it. The poster you replied to was
spot on.

------
jmhodges
If someone manages to port the 64-bit version to Java (which probably requires
some JNI or JNA work), I would be very happy.

~~~
codahale
I just ported it to Java. It took me five minutes.

It's 40 lines of C++, most of which are of the `k *= m;` variety. You
literally paste in the C++, fix the type declarations, and replace the point
increment looping with standard indexed array iteration. Remember to replace
`const` with `final` and you're done.

Using JNI for a high-speed hash function makes only slightly more sense than
putting a SOAP interface on it.

~~~
jmhodges
Yes, and those "k _= m" lines are the problem! Those assume_ unsigned* types!
And 64-bit integers! Those multiplications and other operations are all wrong!

You didn't port this to Java, you ported a broken algorithm to Java. Way to
go, though.

~~~
jmhodges
Sorry, not 64-bit _integers_ but you get my drift.

------
ableal
What puzzled me here was that it took so many years for someone to optimize
this. I looked at the code and dug around for 'barrel shifters'.

Funnily enough, this page
<http://answers.google.com/answers/threadview?id=388350> says that in 1986
both the i386 and 68030 came with one, but it was missing from the Pentium 4.

~~~
DarkShikari
I doubt the Pentium 4 had no barrel shifter, as its shift instructions have
single-cycle latency. It does seem, however, that the Prescott can do rotate
instructions in one cycle while the Northwood took 4 (thanks, Mubench!).

