Simplest way to run benchmark for single class?

Eugene Voytitsky viy.net at gmail.com
Wed Jul 24 04:59:46 PDT 2013


Hi all,

I just git cloned jmh, looked at src and tried to run benchmark for 
bundled JMHSample_11_Loops.class.
And I failed...

I tried to run it from IDEA as app "org.openjdk.jmh.Main -v 
.*JMHSample_11_Loops.*"
I got:
No matching benchmarks. Miss-spelled regexp? Use -v for verbose output.
Benchmarks:

Yes, indeed, I don't have any /META-INF/MicroBenchmarks, so 
MicroBenchmarkList.defaultList() produces empty result.

I wonder why main() so coupled with defaultList() (with presence of 
/META-INF/MicroBenchmarks file) :
     Runner runner = new Runner(cmdOptions);
     runner.run(MicroBenchmarkList.defaultList());

I don't want to write any /META-INF/MicroBenchmarks.
I want to benchmark single class passed as arg to Main.

How to do so?

Thanks in advance.
-- 
Best regards,
Eugene Voytitsky


More information about the jmh-dev mailing list