Running mecirobenchmarks from IDE

Aleksey Shipilev aleksey.shipilev at oracle.com
Mon Jul 7 09:37:56 UTC 2014


On 07/06/2014 08:50 PM, Vladimir Ozerov wrote:
> I see your point, but:
> 1) What do I have to configure Maven tasks? The most user-friendly way to
> launch it is just to click "Run" and don't bother about anything else. It
> is possible since we have all necessary classes already build and available
> in runtime classpath.

JMH requires complex build steps to generate and package the benchmark
code. These steps *do* belong to build system. IDEs should be able to
read the build configuration from, or delegate to, build systems to
properly build complicated projects. It seems to me you are dealing with
the case of misconfigured IDE :)

> 2) What if I do not use Maven at all and, moreover, don't want to use it?

You can use Ant (see jmh-ant-sample), Gradle (see e.g.
https://github.com/melix/jmh-gradle-plugin), or wind up your own build
system if you dislike Maven for some reason.

> The idea behind this feature is to give user ability to run benchmarks
> instantly for quick preliminary assesment of his code, clearly explaining
> him all the risk associated with it.

Unfortunately, this path is paved with sorrow. We do endorse creating
the uberjars and running benchmarks off them to have a clearly isolated
experiments. (Example: how many times I realized my IDE runs several
copies of unit tests in different tabs...)

-Aleksey.


More information about the jmh-dev mailing list