Deprecation notice: @GenerateMicrobenchmark with BenchmarkType

Aleksey Shipilev aleksey.shipilev at oracle.com
Wed Jun 5 05:18:49 PDT 2013


Hi,

As of current JMH 1.0-SNAPSHOT, we deprecate this @GMB with the parameter:

  class C {
     @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
     public void m1() {}

     @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
     public void m2() {}
  }

You should instead use:

  class C {
     @GenerateMicroBenchmark
     @BenchmarkMode(Mode.AverageTime)
     public void m1() {}

     @GenerateMicroBenchmark
     @BenchmarkMode(Mode.AverageTime)
     public void m2() {}
  }

...or, in more concise form,

  @BenchmarkMode(Mode.AverageTime)
  class C {
     @GenerateMicroBenchmark
     public void m1() {}

     @GenerateMicroBenchmark
     public void m2() {}
  }

The deprecated API will be supported for a while, and then removed
without further notice. Please update the benchmarks you are having to
match the new API.

Thanks,
-Aleksey.


More information about the jmh-dev mailing list