Microbenchmarks are written using JMH. They can be executed by using the
:benchmarks:run
:
$ ./gradlew :benchmarks:run
If you want to execute specific benchmarks you can provide a filter argument:
$ ./gradlew :benchmarks:run --args="<benchmarkMethodName | benchmarkClassName>"
To save the results to a file, use the -rf
and -rff
options:
$ ./gradlew :benchmarks:run --args="-rf json -rff /tmp/jmh.json"
If you are writing new benchmarks, take a look at this JMH introduction and these JMH samples.
Version-independent benchmarks which can be written using regular SQL statements are in the crate-benchmarks repository.