JMH issue when storing benchmarks in multiple classes

AVISPA Software avispa at rafalhiszpanski.pl
Mon Nov 11 13:37:12 UTC 2024


Hello,

I decided to have my benchmarks in test resources next to the regular unit
tests so I have a structure like: ClassTest.java, ClassBenchmark.java. I'm
running benchmarks using following code:

public static void main(String[] args) throws RunnerException {
    Options opt = new OptionsBuilder()
            .include(ClassBenchmark.class.getSimpleName())
            .addProfiler(StackProfiler.class)
            //.addProfiler(GCProfiler.class)
            .build();

    new Runner(opt).run();
}

However, when I have a second benchmark, testing different class like
Class2Benchmark.java, after recompilation, running the main method for any
of the benchmarks results in running all sets of benchmarks from both
classes. Both benchmark classes are at the same folder level.

Regards
Rafał Hiszpański

*AVISPA Software Rafał Hiszpański*
NIP: 9591883124
https://rafalhiszpanski.pl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/jmh-dev/attachments/20241111/ff59b7e3/attachment.htm>


More information about the jmh-dev mailing list