Just want the latest results? View them here!
This is a JMH benchmark of open source, embedded, memory-mapped, key-value stores available from Java:
ByteBufferand an Agrona buffer)
(**) does not support ordered keys, so iteration benchmarks not performed
The benchmark includes:
Byte arrays (
byte) are always used for the keys and values, avoiding any
serialization library overhead. For those libraries that support compression,
it is disabled in the benchmark. In general any special library features that
decrease latency (eg batch modes, disable auto-commit, disable journals,
hint at expected data sizes etc) were used. While we have tried to be fair and
consistent, some libraries offer non-obvious tuning settings or usage patterns
that might further reduce their latency. We do not claim we have exhausted
every tuning option every library exposes, but pull requests are most welcome.
This benchmark uses POSIX calls to accurately determine consumed disk space and only depends on Linux-specific native library wrappers where a range of such wrappers exists. Operation on non-Linux operating systems is unsupported.
mvn clean package
java -jar target/benchmarks.jar
The benchmark offers many parameters, but to reduce execution time they default to a fast, mechanically-sympathetic workload (ie integer keys, sequential IO) that should fit in RAM. A default execution takes around 15 minutes on server-grade hardware (ie 2 x Intel Xeon E5-2667 v3 CPUs, 512 GB RAM etc).
You can append
-h to the
java -jar line for JMH help. For example, use:
-foe trueto stop on any error (recommended)
-rf csvto emit a CSV results file (recommended)
-f 3to run three forks for smaller error ranges (recommended)
-lpto list all available parameters
-p intKey=true,falseto test both integer and string-based keys
The parameters (available from
-lp) allow you to create workloads of different
iteration counts (
num), key sizes and layout (
intKey), value sizes
valSize), mechanical sympathy (
valRandom) and feature tuning
System.out will display the actual on-disk usage of each implementation as
"Bytes" \t longVal \t benchId lines. This is not the "apparent" size (given
sparse files are typical), but the actual on-disk space used. The underlying
storage location defaults to the temporary file system. To force an alternate
location, invoke Java with
Please open a GitHub issue if you have any questions.
Contributions are welcome! Please see the LmdbJava project's Contributing Guidelines.
This project is licensed under the Apache License, Version 2.0.