changeset 72:17dd93b91f6d

jmh-core-benchmarks: @GMB -> @BenchmarkMode
author shade
date Tue, 04 Jun 2013 13:29:12 +0400
parents d1e165fb0892
children 538e773eb07b
files jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/BlackholeBench.java jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/DeadCodeBench.java jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/LevelInvocationBench.java jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/LevelIterationBench.java jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/LevelTrialBench.java jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/NanotimeBench.java
diffstat 6 files changed, 68 insertions(+), 61 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/BlackholeBench.java	Tue Jun 04 13:28:58 2013 +0400
+++ b/jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/BlackholeBench.java	Tue Jun 04 13:29:12 2013 +0400
@@ -24,6 +24,7 @@
  */
 package org.openjdk.jmh.benchmarks;
 
+import org.openjdk.jmh.annotations.BenchmarkMode;
 import org.openjdk.jmh.annotations.BenchmarkType;
 import org.openjdk.jmh.annotations.GenerateMicroBenchmark;
 import org.openjdk.jmh.annotations.Level;
@@ -37,6 +38,7 @@
 import java.util.List;
 import java.util.concurrent.TimeUnit;
 
+@BenchmarkMode(BenchmarkType.AverageTimePerOp)
 @OutputTimeUnit(TimeUnit.NANOSECONDS)
 @State(Scope.Thread)
 public class BlackholeBench {
@@ -63,107 +65,107 @@
     public Object o;
     public Object[] os;
 
-    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @GenerateMicroBenchmark
     public void baseline() {
         // do nothing
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @GenerateMicroBenchmark
     public byte implicit_testByte() {
         return b;
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @GenerateMicroBenchmark
     public boolean implicit_testBoolean() {
         return bool;
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @GenerateMicroBenchmark
     public char implicit_testChar() {
         return c;
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @GenerateMicroBenchmark
     public short implicit_testShort() {
         return s;
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @GenerateMicroBenchmark
     public int implicit_testInt() {
         return i;
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @GenerateMicroBenchmark
     public long implicit_testLong() {
         return l;
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @GenerateMicroBenchmark
     public float implicit_testFloat() {
         return f;
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @GenerateMicroBenchmark
     public double implicit_testDouble() {
         return d;
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @GenerateMicroBenchmark
     public Object implicit_testObject() {
         return o;
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @GenerateMicroBenchmark
     public Object[] implicit_testArray() {
         return os;
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @GenerateMicroBenchmark
     public void explicit_testByte(BlackHole bh) {
         bh.consume(b);
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @GenerateMicroBenchmark
     public void explicit_testBoolean(BlackHole bh) {
         bh.consume(bool);
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @GenerateMicroBenchmark
     public void explicit_testChar(BlackHole bh) {
         bh.consume(c);
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @GenerateMicroBenchmark
     public void explicit_testShort(BlackHole bh) {
         bh.consume(s);
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @GenerateMicroBenchmark
     public void explicit_testInt(BlackHole bh) {
         bh.consume(i);
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @GenerateMicroBenchmark
     public void explicit_testLong(BlackHole bh) {
         bh.consume(l);
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @GenerateMicroBenchmark
     public void explicit_testFloat(BlackHole bh) {
         bh.consume(f);
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @GenerateMicroBenchmark
     public void explicit_testDouble(BlackHole bh) {
         bh.consume(d);
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @GenerateMicroBenchmark
     public void explicit_testObject(BlackHole bh) {
         bh.consume(o);
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @GenerateMicroBenchmark
     public void explicit_testArray(BlackHole bh) {
         bh.consume(os);
     }
--- a/jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/DeadCodeBench.java	Tue Jun 04 13:28:58 2013 +0400
+++ b/jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/DeadCodeBench.java	Tue Jun 04 13:29:12 2013 +0400
@@ -25,22 +25,17 @@
 package org.openjdk.jmh.benchmarks;
 
 import org.openjdk.jmh.annotations.BenchmarkType;
-import org.openjdk.jmh.annotations.DefaultMode;
+import org.openjdk.jmh.annotations.BenchmarkMode;
 import org.openjdk.jmh.annotations.GenerateMicroBenchmark;
-import org.openjdk.jmh.annotations.Level;
 import org.openjdk.jmh.annotations.OutputTimeUnit;
 import org.openjdk.jmh.annotations.Scope;
-import org.openjdk.jmh.annotations.Setup;
 import org.openjdk.jmh.annotations.State;
-import org.openjdk.jmh.logic.BlackHole;
 
-import java.util.ArrayList;
-import java.util.List;
 import java.util.concurrent.TimeUnit;
 
 @OutputTimeUnit(TimeUnit.NANOSECONDS)
 @State(Scope.Thread)
-@DefaultMode(BenchmarkType.AverageTimePerOp)
+@BenchmarkMode(BenchmarkType.AverageTimePerOp)
 public class DeadCodeBench {
 
     public int x = 1;
--- a/jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/LevelInvocationBench.java	Tue Jun 04 13:28:58 2013 +0400
+++ b/jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/LevelInvocationBench.java	Tue Jun 04 13:29:12 2013 +0400
@@ -24,6 +24,7 @@
  */
 package org.openjdk.jmh.benchmarks;
 
+import org.openjdk.jmh.annotations.BenchmarkMode;
 import org.openjdk.jmh.annotations.BenchmarkType;
 import org.openjdk.jmh.annotations.GenerateMicroBenchmark;
 import org.openjdk.jmh.annotations.Level;
@@ -35,6 +36,7 @@
 
 import java.util.concurrent.TimeUnit;
 
+@BenchmarkMode(BenchmarkType.All)
 @OutputTimeUnit(TimeUnit.NANOSECONDS)
 public class LevelInvocationBench {
 
@@ -101,37 +103,37 @@
         public void tearDown() {}
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     @OutputTimeUnit(TimeUnit.NANOSECONDS)
     public void raw() {
         // do nothing
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void benchmark_setup_teardown(BenchmarkSetupTeardown g) {}
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void benchmark_setup(BenchmarkSetup g) {}
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void benchmark_teardown(BenchmarkTeardown g) {}
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void group_setup_teardown(GroupSetupTeardown g) {}
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void group_setup(GroupSetup g) {}
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void group_teardown(GroupTeardown g) {}
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void thread_setup_teardown(ThreadSetupTeardown g) {}
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void thread_setup(ThreadSetup g) {}
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void thread_teardown(ThreadTeardown g) {}
 
 }
--- a/jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/LevelIterationBench.java	Tue Jun 04 13:28:58 2013 +0400
+++ b/jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/LevelIterationBench.java	Tue Jun 04 13:29:12 2013 +0400
@@ -24,6 +24,7 @@
  */
 package org.openjdk.jmh.benchmarks;
 
+import org.openjdk.jmh.annotations.BenchmarkMode;
 import org.openjdk.jmh.annotations.BenchmarkType;
 import org.openjdk.jmh.annotations.GenerateMicroBenchmark;
 import org.openjdk.jmh.annotations.Level;
@@ -35,6 +36,7 @@
 
 import java.util.concurrent.TimeUnit;
 
+@BenchmarkMode(BenchmarkType.All)
 @OutputTimeUnit(TimeUnit.NANOSECONDS)
 public class LevelIterationBench {
 
@@ -101,37 +103,37 @@
         public void tearDown() {}
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     @OutputTimeUnit(TimeUnit.NANOSECONDS)
     public void raw() {
         // do nothing
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void benchmark_setup_teardown(BenchmarkSetupTeardown g) {}
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void benchmark_setup(BenchmarkSetup g) {}
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void benchmark_teardown(BenchmarkTeardown g) {}
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void group_setup_teardown(GroupSetupTeardown g) {}
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void group_setup(GroupSetup g) {}
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void group_teardown(GroupTeardown g) {}
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void thread_setup_teardown(ThreadSetupTeardown g) {}
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void thread_setup(ThreadSetup g) {}
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void thread_teardown(ThreadTeardown g) {}
 
 }
--- a/jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/LevelTrialBench.java	Tue Jun 04 13:28:58 2013 +0400
+++ b/jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/LevelTrialBench.java	Tue Jun 04 13:29:12 2013 +0400
@@ -24,6 +24,7 @@
  */
 package org.openjdk.jmh.benchmarks;
 
+import org.openjdk.jmh.annotations.BenchmarkMode;
 import org.openjdk.jmh.annotations.BenchmarkType;
 import org.openjdk.jmh.annotations.GenerateMicroBenchmark;
 import org.openjdk.jmh.annotations.Level;
@@ -35,6 +36,7 @@
 
 import java.util.concurrent.TimeUnit;
 
+@BenchmarkMode(BenchmarkType.All)
 @OutputTimeUnit(TimeUnit.NANOSECONDS)
 public class LevelTrialBench {
 
@@ -101,37 +103,37 @@
         public void tearDown() {}
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     @OutputTimeUnit(TimeUnit.NANOSECONDS)
     public void raw() {
         // do nothing
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void benchmark_setup_teardown(BenchmarkSetupTeardown g) {}
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void benchmark_setup(BenchmarkSetup g) {}
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void benchmark_teardown(BenchmarkTeardown g) {}
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void group_setup_teardown(GroupSetupTeardown g) {}
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void group_setup(GroupSetup g) {}
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void group_teardown(GroupTeardown g) {}
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void thread_setup_teardown(ThreadSetupTeardown g) {}
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void thread_setup(ThreadSetup g) {}
 
-    @GenerateMicroBenchmark(BenchmarkType.All)
+    @GenerateMicroBenchmark
     public void thread_teardown(ThreadTeardown g) {}
 
 }
--- a/jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/NanotimeBench.java	Tue Jun 04 13:28:58 2013 +0400
+++ b/jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/NanotimeBench.java	Tue Jun 04 13:29:12 2013 +0400
@@ -24,6 +24,7 @@
  */
 package org.openjdk.jmh.benchmarks;
 
+import org.openjdk.jmh.annotations.BenchmarkMode;
 import org.openjdk.jmh.annotations.BenchmarkType;
 import org.openjdk.jmh.annotations.GenerateMicroBenchmark;
 import org.openjdk.jmh.annotations.OutputTimeUnit;
@@ -38,12 +39,14 @@
 
     private long last;
 
-    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @GenerateMicroBenchmark
+    @BenchmarkMode(BenchmarkType.AverageTimePerOp)
     public long latency_avg() {
         return System.nanoTime();
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @GenerateMicroBenchmark
+    @BenchmarkMode(BenchmarkType.AverageTimePerOp)
     public long granularity_avg() {
         long lst = last;
         long cur;
@@ -54,7 +57,8 @@
         return cur;
     }
 
-    @GenerateMicroBenchmark(BenchmarkType.SampleTimePerOp)
+    @GenerateMicroBenchmark
+    @BenchmarkMode(BenchmarkType.SampleTimePerOp)
     public long granularity() {
         long lst = last;
         long cur;