https://github.com/friskisgit/jmh-template
JMH ready-to-use template
https://github.com/friskisgit/jmh-template
benchmark java jmh jmh-benchmarks template
Last synced: about 1 year ago
JSON representation
JMH ready-to-use template
- Host: GitHub
- URL: https://github.com/friskisgit/jmh-template
- Owner: FriskIsGit
- Created: 2025-04-08T20:34:02.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-08T21:25:19.000Z (about 1 year ago)
- Last Synced: 2025-04-08T21:32:53.772Z (about 1 year ago)
- Topics: benchmark, java, jmh, jmh-benchmarks, template
- Language: Java
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# JMH template
This is a minimal, ready-to-use project for benchmarking with JMH - https://github.com/openjdk/jmh.
### Steps
```sh
git clone https://github.com/FriskIsGit/JMH-template
```
```sh
./mvnw clean install
```
```sh
java -jar target/benchmark-1.jar
```
### Modifying the benchmark
The method annotated with `@Benchmark` in [Experiment.java](src/bench/Experiment.java) is the tested method.
[ExperimentRunner.java](src/bench/ExperimentRunner.java) is program's entry point where you can modify parameters like
the number of forks, measurement time, warmup iterations etc.
### Maven
This template includes **Maven wrapper**, `mvnw` and `mvnw.cmd` wrapper scripts.
`mvnw.cmd` was modified to prevent a powershell syntax error tied to `maven-wrapper.jar` download (if it's missing).