changeset 67:08762bbbb164

Minor touchup in DeadCodeBench
author shade
date Mon, 03 Jun 2013 12:47:44 +0400
parents 2dd809be0535
children 2256f5d6d057
files jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/DeadCodeBench.java
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/DeadCodeBench.java	Fri May 31 17:46:19 2013 +0400
+++ b/jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/DeadCodeBench.java	Mon Jun 03 12:47:44 2013 +0400
@@ -41,7 +41,8 @@
 @State(Scope.Thread)
 public class DeadCodeBench {
 
-    public int i;
+    public int x = 1;
+    public int y = 2;
 
     @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
     public void base() {
@@ -50,11 +51,11 @@
 
     @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
     public int constant() {
-        return 42;
+        return 3;
     }
 
     @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
     public int payload() {
-        return (int) Math.pow(i, 42);
+        return x + y;
     }
 }