Skip to content

Commit 13620d6

Browse files
committed
Add LMDB system library benchmark
1 parent 23b0b41 commit 13620d6

6 files changed

Lines changed: 910 additions & 1 deletion

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: LMDB Benchmarks
2+
3+
on:
4+
# Manual trigger
5+
workflow_dispatch:
6+
7+
# Daily at 4am UTC (offset from other workflows)
8+
schedule:
9+
- cron: '0 4 * * *'
10+
11+
jobs:
12+
benchmark:
13+
name: Run LMDB Benchmarks
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 120
16+
17+
steps:
18+
- name: Check out repository
19+
uses: actions/checkout@v5
20+
21+
- name: Set up JDK
22+
uses: actions/setup-java@v5
23+
with:
24+
java-version: '25'
25+
distribution: 'temurin'
26+
cache: maven
27+
28+
- name: Build benchmarks JAR
29+
run: mvn -B clean package -DskipTests
30+
31+
- name: Install dependencies for report generation and LMDB compilation
32+
run: sudo apt-get update && sudo apt-get install -y gnuplot jq gcc make
33+
34+
- name: Run LMDB benchmarks (smoketest mode, compiles LMDB libraries automatically)
35+
run: ./run-lmdb.sh smoketest
36+
timeout-minutes: 60
37+
38+
- name: Generate LMDB report
39+
run: ./report-lmdb.sh
40+
41+
- name: Install wrangler
42+
run: npm install -g wrangler
43+
44+
- name: Publish results to Cloudflare Pages
45+
run: ./publish-results.sh
46+
env:
47+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
48+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ dependency-reduced-pom.xml
1818
/log.txt
1919
/bisect
2020
/dev
21+
/lmdb
2122
*.backup

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[![Library Benchmarks](https://github.com/lmdbjava/benchmarks/workflows/Library%20Benchmarks/badge.svg)](https://github.com/lmdbjava/benchmarks/actions)
22
[![Version Benchmarks](https://github.com/lmdbjava/benchmarks/workflows/Version%20Benchmarks/badge.svg)](https://github.com/lmdbjava/benchmarks/actions)
3+
[![LMDB Benchmarks](https://github.com/lmdbjava/benchmarks/workflows/LMDB%20Benchmarks/badge.svg)](https://github.com/lmdbjava/benchmarks/actions)
34
[![License](https://img.shields.io/hexpm/l/plug.svg?maxAge=2592000)](http://www.apache.org/licenses/LICENSE-2.0.txt)
45

56
# LmdbJava Benchmarks
@@ -8,6 +9,7 @@
89

910
- **Library Comparisons**: [Full Benchmark](https://libraries-benchmark.lmdbjava.org) | [Smoketest](https://libraries-smoketest.lmdbjava.org)
1011
- **Version Regressions**: [Full Benchmark](https://versions-benchmark.lmdbjava.org) | [Smoketest](https://versions-smoketest.lmdbjava.org)
12+
- **LMDB Benchmarks**: [Full Benchmark](https://lmdb-benchmark.lmdbjava.org) | [Smoketest](https://lmdb-smoketest.lmdbjava.org)
1113
- **Historical**: [2016 Results](https://github.com/lmdbjava/benchmarks/blob/master/results/20160710/README.md)
1214

1315
This is a [JMH](http://openjdk.java.net/projects/code-tools/jmh/) benchmark
@@ -134,6 +136,31 @@ rm -rf target/benchmark-vers
134136
./run-vers.sh benchmark
135137
```
136138

139+
#### LMDB Benchmarks
140+
141+
Use the `run-lmdb.sh` script to test LmdbJava (master) performance across different LMDB library versions:
142+
143+
```bash
144+
# Quick smoke test (1K entries, fast verification)
145+
./run-lmdb.sh smoketest
146+
147+
# Full benchmark using 25% of system RAM (default)
148+
./run-lmdb.sh benchmark
149+
150+
# Full benchmark using 50% of system RAM
151+
./run-lmdb.sh benchmark 50
152+
```
153+
154+
This tests LmdbJava master against 9 different LMDB library versions (0.9.18-0.9.33) to isolate LMDB native library performance characteristics from LmdbJava wrapper code.
155+
Results are written to `target/benchmark-lmdb/`.
156+
157+
**Resumption:** The script skips completed LMDB versions by checking for existing result files. For a fresh run, remove the output directory:
158+
159+
```bash
160+
rm -rf target/benchmark-lmdb
161+
./run-lmdb.sh benchmark
162+
```
163+
137164
#### Running Both Benchmark Suites
138165

139166
Use the `run-both.sh` script to run both library and version benchmarks sequentially (designed for overnight runs):
@@ -162,6 +189,12 @@ After running version regression tests, generate a version comparison report:
162189
./report-vers.sh
163190
```
164191

192+
After running LMDB benchmarks, generate an LMDB performance report:
193+
194+
```bash
195+
./report-lmdb.sh
196+
```
197+
165198
Reports generate:
166199
- `target/benchmark/README.md` - Full markdown report with charts
167200
- `target/benchmark/index.html` - HTML viewer with embedded charts (open in browser)

publish-results.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,12 @@ if grep -q "## LmdbJava Library Comparison Benchmarks" "${README}"; then
6464
elif grep -q "## LmdbJava Performance Regression Testing" "${README}"; then
6565
BENCH_TYPE="versions"
6666
echo " Detected: Version regression benchmarks"
67+
elif grep -q "## LMDB Library Performance Analysis" "${README}"; then
68+
BENCH_TYPE="lmdb"
69+
echo " Detected: LMDB library benchmarks"
6770
else
6871
echo "ERROR: Could not determine benchmark type from ${README}"
69-
echo "Expected heading: '## LmdbJava Library Comparison Benchmarks' or '## LmdbJava Performance Regression Testing'"
72+
echo "Expected heading: '## LmdbJava Library Comparison Benchmarks', '## LmdbJava Performance Regression Testing', or '## LMDB Library Performance Analysis'"
7073
exit 1
7174
fi
7275

0 commit comments

Comments
 (0)