Giter Club home page Giter Club logo

benchmarks's Introduction

Build Status License

LmdbJava Benchmarks

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:

(**) does not support ordered keys, so iteration benchmarks not performed

The benchmark itself is adapted from LMDB's db_bench_mdb.cc, which in turn is adapted from LevelDB's benchmark.

The benchmark includes:

  • Writing data
  • Reading all data via each key
  • Reading all data via a reverse iterator
  • Reading all data via a forward iterator
  • Reading all data via a forward iterator and computing a CRC32 (via JDK API)
  • Reading all data via a forward iterator and computing a XXH64 (via extremely fast Zero-Allocation-Hashing)

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.

Usage

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.

  1. Clone this repository and mvn clean package
  2. Run the benchmark with 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 true to stop on any error (recommended)
  • -rf csv to emit a CSV results file (recommended)
  • -f 3 to run three forks for smaller error ranges (recommended)
  • -lp to list all available parameters
  • -p intKey=true,false to 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 (sequential, valRandom) and feature tuning (eg forceSafe, writeMap etc).

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 -Djava.io.tmpdir=/somewhere/you/like.

Support

Please open a GitHub issue if you have any questions.

Contributing

Contributions are welcome! Please see the LmdbJava project's Contributing Guidelines.

License

This project is licensed under the Apache License, Version 2.0.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.