Parametrise @Threads

Aleksey Shipilev aleksey.shipilev at oracle.com
Wed May 18 22:05:21 UTC 2016


On 04/29/2016 07:35 PM, Joel Moberg wrote:
> I googled the list to find a way to parametrise the number of threads used
> for a benchmark. This question was asked before here:
> http://mail.openjdk.java.net/pipermail/jmh-dev/2014-October/001423.html.
> There is a link to a issue describing that @Threads could accept
> parameters. The suggestion is to either let some annotations accept a
> sequence, or let users be able parametrize with @Params annotation. I think
> the first suggestion is better, and maybe easier to implement (if
> annotations can extend a base annotation?). I have not written any
> annotation code yet. But I want this feature, and want to know if there
> still is interest. Is there any way I can help?

There is still interest. Alas, this touches the very core of JMH, and
the required effort is not trivial. Many volunteers stepped forward with
trying to implement this, never to be heard again.

But, it is somewhat offset by the usual motto: annotations are not
supposed to cover every single case -- expressing DSLs in annotations
really sucks. If you need to code up some advanced scenario, use the
Java API.

Thanks,
-Aleksey



More information about the jmh-dev mailing list