Skip to content

Commit c5befb3

Browse files
committed
Refactor benchmark execution and reporting scripts
1 parent 2614235 commit c5befb3

File tree

6 files changed

+1769
-317
lines changed

6 files changed

+1769
-317
lines changed

.github/workflows/maven.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,19 @@ jobs:
2525
- name: Build with Maven
2626
run: mvn -B verify
2727

28-
- name: Simple benchmark test
29-
run: |
30-
java --add-opens java.base/java.lang=ALL-UNNAMED \
31-
--add-opens java.base/java.lang.reflect=ALL-UNNAMED \
32-
--add-opens java.base/java.nio=ALL-UNNAMED \
33-
--add-exports java.base/jdk.internal.misc=ALL-UNNAMED \
34-
--add-exports java.base/sun.nio.ch=ALL-UNNAMED \
35-
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
36-
--enable-native-access=ALL-UNNAMED \
37-
-jar target/benchmarks.jar -foe true -wi 0 -i 1 -f 1 -p num=512 -r 3s
28+
- name: Install gnuplot for report generation
29+
run: sudo apt-get update && sudo apt-get install -y gnuplot
30+
31+
- name: Run smoketest benchmarks
32+
run: ./run.sh smoketest
33+
34+
- name: Generate benchmark report
35+
run: ./report.sh
36+
37+
- name: Upload benchmark results
38+
uses: actions/upload-artifact@v4
39+
if: always()
40+
with:
41+
name: benchmark-smoketest-results
42+
path: target/benchmark/
43+
retention-days: 7

README.md

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -59,42 +59,40 @@ This benchmark uses POSIX calls to accurately determine consumed disk space and
5959
only depends on Linux-specific native library wrappers where a range of such
6060
wrappers exists. Operation on non-Linux operating systems is unsupported.
6161

62-
Run the benchmark:
62+
### Running Benchmarks
63+
64+
Use the provided `run.sh` script to execute benchmarks:
6365

6466
```bash
65-
java --add-opens java.base/java.lang=ALL-UNNAMED \
66-
--add-opens java.base/java.lang.reflect=ALL-UNNAMED \
67-
--add-opens java.base/java.nio=ALL-UNNAMED \
68-
--add-exports java.base/jdk.internal.misc=ALL-UNNAMED \
69-
--add-exports java.base/sun.nio.ch=ALL-UNNAMED \
70-
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
71-
--enable-native-access=ALL-UNNAMED \
72-
-jar target/benchmarks.jar
67+
# Quick smoke test (1K entries, fast verification)
68+
./run.sh smoketest
69+
70+
# Full benchmark using 25% of system RAM (default)
71+
./run.sh benchmark
72+
73+
# Full benchmark using 50% of system RAM
74+
./run.sh benchmark 50
75+
76+
# Full benchmark using 100% of system RAM
77+
./run.sh benchmark 100
7378
```
7479

75-
The benchmark offers many parameters, but to reduce execution time they default
76-
to a fast, mechanically-sympathetic workload (ie integer keys, sequential IO)
77-
that should fit in RAM. A default execution takes around 15 minutes on
78-
server-grade hardware (ie 2 x Intel Xeon E5-2667 v3 CPUs, 512 GB RAM etc).
80+
The benchmark auto-scales based on available RAM and caps at 1 million entries.
81+
Results are written to `target/benchmark/out-1.json` through `target/benchmark/out-6.json`
82+
along with human-readable logs in `target/benchmark/out-1.txt` through `target/benchmark/out-6.txt`.
7983

80-
You can append ``-h`` to the ``java -jar`` line for JMH help. For example, use:
84+
### Generating Reports
8185

82-
* ``-foe true`` to stop on any error (recommended)
83-
* ``-rf csv`` to emit a CSV results file (recommended)
84-
* ``-f 3`` to run three forks for smaller error ranges (recommended)
85-
* ``-lp`` to list all available parameters
86-
* ``-p intKey=true,false`` to test both integer and string-based keys
86+
After running benchmarks, generate a comprehensive report with charts:
8787

88-
The parameters (available from `-lp`) allow you to create workloads of different
89-
iteration counts (`num`), key sizes and layout (`intKey`), value sizes
90-
(`valSize`), mechanical sympathy (`sequential`, `valRandom`) and feature tuning
91-
(eg `forceSafe`, `writeMap` etc).
88+
```bash
89+
./report.sh
90+
```
9291

93-
``System.out`` will display the actual on-disk usage of each implementation as
94-
``"Bytes" \t longVal \t benchId`` lines. This is not the "apparent" size (given
95-
sparse files are typical), but the actual on-disk space used. The underlying
96-
storage location defaults to the temporary file system. To force an alternate
97-
location, invoke Java with `-Djava.io.tmpdir=/somewhere/you/like`.
92+
This generates:
93+
- `target/benchmark/README.md` - Full markdown report with charts
94+
- `target/benchmark/index.html` - HTML viewer with embedded charts (open in browser)
95+
- Various SVG charts and supporting files
9896

9997
## Version Management
10098

@@ -106,8 +104,8 @@ mvn versions:update-properties
106104

107105
## Support
108106

109-
Please [open a GitHub issue](https://github.com/lmdbjava/benchmarks/issues)
110-
if you have any questions.
107+
Issues are disabled for this repository. Please report any issues or questions
108+
on the [LmdbJava issue tracker](https://github.com/lmdbjava/lmdbjava/issues).
111109

112110
## Contributing
113111

0 commit comments

Comments
 (0)