The following charts show the most important results of our Java hash functions performance benchmarks. For details, have a look at the Java hash function data PDF
In this test, our Murmur3 implementations perform pretty well. Murmur3F outperforms Java’s CRC32 by factor 4 and Guava’s implementation of the same hash by factor 10.
Two observations: 1.) Adler32 is outdated (and wasn’t designed as a hash). 2.) All other hash functions and the CRC checksum perform equally well with random data.
Test platform: Intel® Core™ i7-3720QM (2012), Windows 8 (64 bit), Java 7u72
Other interesting hash functions
- Another simple Murmur3a Java implementation in the public domain:
- CityHash can make use of hardware CRC:
http://en.wikipedia.org/wiki/CityHash and https://code.google.com/p/cityhash/
- Hash classics by Bob Jenkins:
- And Bob Jenkins’ modern 128-bit SpookyHash:
- SipHash 64 bits has a secret 128 bit key and claims to be strong against DoS attacks:
- A lesser known hash function claiming to be very fast while maintaining good SMHasher properties:
- xxHash claims to be fast for current x86 while having great hashing properties (however, the tested Java version produced lots of hash collisions):
Hash function studies
“Empirical Evaluation of Hash Functions for Multipoint Measurements”, Christian Henke, Carsten Schmoll, Tanja Zseby, ACM SIGCOMM Computer Communication Review archive Volume 38 Issue 3, July 2008, Pages 39-50.