Unable to run validation.jar benchmarks
Matt Warren
matt.warren at live.co.uk
Thu Dec 18 12:42:14 UTC 2014
Hi
If I try to run the validation benchmarks, I get a RunnerException message,
see below:
C:\dev\jmh\jmh-core-benchmarks>java -jar target\validation.jar
JMH Infrastructure Validation Tests
-------------------------------------------------------------------------
Basic benchmark tests:
These tests show the basic overheads of calling the benchmark method.
Additionally, the overheads of calling empty Fixture methods are measured.
running empty benchmark: 5.95 +- 7.52 ns
> Multiple matching benchmarks (expected only 1):
> org.openjdk.jmh.benchmarks.LevelTrialBench.*benchmark_setup*
> org.openjdk.jmh.benchmarks.LevelTrialBench.
*benchmark_setup_teardown*
Exception in thread "main" org.openjdk.jmh.runner.RunnerException: More
than single benchmark is matching the options
at org.openjdk.jmh.runner.Runner.runSingle(Runner.java:169)
at org.openjdk.jmh.MainValidation.basic(MainValidation.java:85)
at org.openjdk.jmh.MainValidation.main(MainValidation.java:55)
C:\dev\jmh\jmh-core-benchmarks>
The lines starting ">" are my own debugging code and they show the problem.
The code is calling runSingle(), but there are multiple benchmarks that
match the regex.
One fix is to change the regex (in
jmh\jmh-core-benchmarks\src\main\java\org\openjdk\jmh\MainValidation.java)
so that it includes the anchor character '$', i.e. from
Options opts = new OptionsBuilder()
.include(LevelTrialBench.class.getCanonicalName() +
".*benchmark_setup")
.verbosity(VerboseMode.SILENT)
.build();
to
Options opts = new OptionsBuilder()
.include(LevelTrialBench.class.getCanonicalName() +
".*benchmark_setup*$*")
.verbosity(VerboseMode.SILENT)
.build();
This fix would have to be replicated in a few other places in
MainValidation.java, as other tests also fail. But I don't know if this
fits with what the code is supposed to be doing?
Cheers
Matt
More information about the jmh-dev
mailing list