RFR: remove unnecessary bechmark.call() before synchIteration loop

Sergey Kuksenko sergey.kuksenko at oracle.com
Tue Jun 11 06:58:46 PDT 2013


Right now, GenerateMicroBenchmarkProcessor creates code where the first 
iteration of the synch-itertation loop is peeled. Such peeling is 
useless. Let's remove it.

-------------------patch starts here---------------------------------
diff -r fa5be564f884 
jmh-core/src/main/java/org/openjdk/jmh/processor/internal/GenerateMicroBenchmarkProcessor.java
--- 
a/jmh-core/src/main/java/org/openjdk/jmh/processor/internal/GenerateMicroBenchmarkProcessor.java 
Tue Jun 11 17:12:45 2013 +0400
+++ 
b/jmh-core/src/main/java/org/openjdk/jmh/processor/internal/GenerateMicroBenchmarkProcessor.java 
Tue Jun 11 17:52:01 2013 +0400
@@ -721,12 +721,6 @@

              iterationProlog(writer, 3, method, states);

-
-            // synchronize iterations prolog: first peeled iteration
-            invocationProlog(writer, 3, method, states, false);
-            writer.println(ident(3) + emitCall(method, states) + ';');
-            invocationEpilog(writer, 3, method, states, false);
-
              // synchronize iterations prolog: announce ready
              writer.println(ident(3) + "loop.announceWarmupReady();");

@@ -816,11 +810,6 @@

              iterationProlog(writer, 3, method, states);

-            // synchronize iterations prolog: first peeled iteration
-            invocationProlog(writer, 3, method, states, false);
-            writer.println(ident(3) + emitCall(method, states) + ';');
-            invocationEpilog(writer, 3, method, states, false);
-
              // synchronize iterations prolog: announce ready
              writer.println(ident(3) + "loop.announceWarmupReady();");

@@ -929,11 +918,6 @@

              iterationProlog(writer, 3, method, states);

-            // synchronize iterations prolog: first peeled iteration
-            invocationProlog(writer, 3, method, states, false);
-            writer.println(ident(3) + emitCall(method, states) + ';');
-            invocationEpilog(writer, 3, method, states, false);
-
              // synchronize iterations prolog: announce ready
              writer.println(ident(3) + "loop.announceWarmupReady();");



More information about the jmh-dev mailing list