Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 755 Bytes

README.md

File metadata and controls

34 lines (24 loc) · 755 Bytes

Performance measurement with JMH – Java Microbenchmark Harness

JMH is a tool for measuring Java code performance, primarily focused on microbenchmarks.

New project

To create a new project that supports JMH run with maven:

$ mvn archetype:generate \
          -DinteractiveMode=false \
          -DarchetypeGroupId=org.openjdk.jmh \
          -DarchetypeArtifactId=jmh-java-benchmark-archetype \
          -DgroupId=com.company \
          -DartifactId=jmhTest \
          -Dversion=1.0

Build the benchmarks

Run this Maven command in the root folder of your project:

mvn clean install

Run the benchmarks

Run this Maven command in the root folder of your project:

java -jar target/benchmarks.jar