/hasher

Java implementation of Murmur2, Murmur3, XXHash, FNV1 and FNV1A.

Primary LanguageJavaApache License 2.0Apache-2.0

Hasher

This project contains Java implementation for the following fast non-cryptographic hash algorithms

  • Murmur2 - 32, 64-bit variants
  • Murmur3 - 32, 64, 128-bit variants
  • XXHash - 64-bit variant
  • FNV1 - 32, 64-bit variants
  • FNV1A - 32, 64-bit variants

JMH Microbenchmark

Running locally

To run the benchmark on your local machine

git clone https://github.com/prasanthj/hasher.git

cd hasher

mvn clean install

To run all benchmarks

java -jar target/benchmarks.jar

(OR) with custom iterations (wi - warmup iterations, i - iterations, f - fork)

java -jar target/benchmarks.jar -wi 5 -i 10 -f 1

To run a specific benchmark

java -jar target/benchmarks.jar Benchmark32BitHash -wi 5 -i 10 -f 1

Results

NOTE: Its always good to run the benchmarks on your local machine as YMMV.

Latest results can be found here. All results are generated with the following setup.

Benchmark Setup

  • Java version: 1.7.0_40 (64-Bit Server VM)
  • Operating system: Mac OS X v10.10 (Yosemite)
  • Processor: 2.7 GHz Intel Core i7
  • Memory: 16GB 1600 MHz DDR3
  • Storage: 500GB Flash Storage

Results

Issues

Bug fixes or improvements are welcome! Please fork the project and send pull request on github. Or report issues here https://github.com/prasanthj/hasher/issues