This directory contains the microbenchmark suite of OpenSearch SQL/PPL. It relies on JMH.
Microbenchmarks are intended to spot performance regressions in performance-critical components.
The microbenchmark suite is also handy for ad-hoc microbenchmarks but please remove them again before merging your PR.
Just run ./gradlew :benchmarks:jmh
from the project root directory or run specific benchmark via your IDE. It will build all microbenchmarks, execute them and print the result.
Before adding a new microbenchmark, make yourself familiar with the JMH API. You can check our existing microbenchmarks and also the JMH samples.
In contrast to tests, the actual name of the benchmark class is not relevant to JMH. However, stick to the naming convention and end the class name of a benchmark with Benchmark
. To have JMH execute a benchmark, annotate the respective methods with @Benchmark
.