Gotchas with avoiding benchmarks.jar

Brian Harris brianfromoregon at gmail.com
Fri Aug 22 16:36:12 UTC 2014


I have jmh integrated with our build environment at work now. The template
benchmark is this

public class HelloJmhTest {
  @Benchmark public void wellHelloThere() {}

  @Test public void run() throws RunnerException {
    Options opt = new ...
    new Runner(opt).run();
  }
}

That is, same as your samples except replacing psvm with junit @Test. Rest
assured, these jmh "tests" are segregated from the real tests and they are
run on a dedicated Jenkins slave which is otherwise completely quiet. I
just use junit as the runner hook because it's so damn convenient.

I'm wondering what are the gotchas with not using the benchmarks.jar setup
that you recommend. The classpath will be huge, will that be a problem?

Thanks,
Brian


More information about the jmh-dev mailing list