Maven integration
Aleksey Shipilev
aleksey.shipilev at oracle.com
Mon May 6 04:20:10 PDT 2013
On 05/04/2013 03:22 PM, Julien Nicoulaud wrote:
> First of all thanks for this great tool, this is a real game changer.
Thanks for the feedback!
> I started working on a Maven plugin for JMH, but a few things complicate
> JMH embedding:
Good, although I would puritanically back off letting people to run
performance benchmarks in the course of the build.
> - Arguments parsing: it would be great if there was a version
> of HarnessOptions with setters
Note of warning: you will rely on the internal APIs, which are not
guaranteed to stay the same. We are actually contemplating the proper
Java API to get access JMH without messing with the command line
options.
But meanwhile, assuming you are using the new Runner(harnessOptions) as
your entry point, I had changed the *Option fields to "protected", so
you have the opportunity to subclass them and access the plain fields.
This makes things relatively isolated without exposing the setters.
> - Classloading: JMH's ClassUtils.loadClass() manually builds an
> URLClassLoader, which breaks classloader inheritance, but I don't know if
> there is a better option.
Yes, that allows us additional degree of isolation for the
microbenchmarks. But then again, this isolation is not perfect, and we
must instead rely on forking to segregate the microbenchmark effects.
Hence, I pushed away from that and jmh instead does the plain class
loading (with the option to revert back to separate classloader).
-Aleksey.
P.S. Please consider filling out the OCA on the chance you would like to
push the patches to JMH at some point:
http://openjdk.java.net/contribute/
More information about the jmh-dev
mailing list