This directory contains the upstream C benchmark provided by the LMDB maintainer in response to ITS#10406 - our report of write performance regression.
This benchmark serves as an authoritative baseline for validating LMDB performance across versions:
- Uses native C code (eliminates JNI overhead)
- Provided directly by LMDB maintainer
- Matches our Java benchmark scenario (sequential append with integer keys)
- Enables comparison between Java and C performance characteristics
mtest-append-original.c- Upstream benchmark code from ITS#10406 (unmodified)mtest-append.c- Modified benchmark for testing different scenariosrun-upstream-bench.sh- Test harness to run across multiple LMDB versionstarget/- Build artifacts and results (gitignored)target/mtest-append- Compiled benchmark binarytarget/results/- Benchmark results for each LMDB version
- Operation: Sequential writes using
MDB_APPENDflag - Key Type: Integer keys (
MDB_INTEGERKEY) - Entry Count: 1,000,000
- Value Size: 100 bytes (zeroed)
- Commit Frequency: Every 1,000 entries (1,000 transactions total)
- Flags:
MDB_NOSYNC(for consistency with Java benchmarks) - Iterations: 3 runs per version
./run-upstream-bench.shResults are saved to target/results/upstream-LMDB_<version>.txt
The script automatically:
- Checks out each LMDB version from the OpenLDAP repository
- Compiles the LMDB library
- Compiles and runs the benchmark
- Generates a summary comparison table
Each benchmark iteration completes in ~0.075 seconds on modern hardware. Total runtime for all 14 versions (3 iterations each): ~1 minute.
This C benchmark can be compared with LmdbJava benchmarks at https://lmdb-benchmark.lmdbjava.org/
Key differences:
- C benchmark uses raw LMDB API (no JNI overhead)
- C benchmark commits every 1,000 entries vs Java's single-transaction approach
- Results help isolate whether regressions are in LMDB itself or JNI layer
Licensed under the OpenLDAP Public License (see mtest-append-original.c for copyright details).