changeset 433:820cca158d4b

Yak shaving: Padding should use shorted field names (saves up to 20% source length).
author shade
date Fri, 28 Feb 2014 02:51:25 +0400
parents 824c1925e81e
children 90b8b2c8934b
files jmh-core/src/main/java/org/openjdk/jmh/generators/annotations/AnnProcessGeneratorSource.java jmh-core/src/main/java/org/openjdk/jmh/generators/core/BenchmarkGenerator.java jmh-core/src/main/java/org/openjdk/jmh/generators/core/StateObjectHandler.java
diffstat 3 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/annotations/AnnProcessGeneratorSource.java	Fri Feb 28 01:49:27 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/generators/annotations/AnnProcessGeneratorSource.java	Fri Feb 28 02:51:25 2014 +0400
@@ -36,6 +36,7 @@
 import javax.lang.model.util.ElementFilter;
 import javax.tools.Diagnostic;
 import javax.tools.StandardLocation;
+import java.io.BufferedWriter;
 import java.io.IOException;
 import java.io.Writer;
 import java.util.ArrayList;
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/core/BenchmarkGenerator.java	Fri Feb 28 01:49:27 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/generators/core/BenchmarkGenerator.java	Fri Feb 28 02:51:25 2014 +0400
@@ -64,6 +64,7 @@
 import org.openjdk.jmh.util.internal.SampleBuffer;
 
 import javax.annotation.Generated;
+import java.io.BufferedWriter;
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.lang.annotation.IncompleteAnnotationException;
@@ -504,9 +505,9 @@
         for (int p = 0; p < 16; p++) {
             StringBuilder sb = new StringBuilder();
             sb.append(ident(1));
-            sb.append("boolean jmh_pad_").append(p);
+            sb.append("private boolean p").append(p);
             for (int q = 1; q < 16; q++) {
-                sb.append(", jmh_pad_").append(p).append("_").append(q);
+                sb.append(", p").append(p).append("_").append(q);
             }
             sb.append(";");
             writer.println(sb.toString());
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/core/StateObjectHandler.java	Fri Feb 28 01:49:27 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/generators/core/StateObjectHandler.java	Fri Feb 28 02:51:25 2014 +0400
@@ -575,9 +575,9 @@
     public static void padding(List<String> lines, String suffix) {
         for (int p = 0; p < 16; p++) {
             StringBuilder sb = new StringBuilder();
-            sb.append("    boolean jmh_").append(suffix).append("_pad_").append(p);
+            sb.append("    private boolean p").append(suffix).append("_").append(p);
             for (int q = 1; q < 16; q++) {
-                sb.append(", jmh_").append(suffix).append("_pad_").append(p).append("_").append(q);
+                sb.append(", p").append(suffix).append("_").append(p).append("_").append(q);
             }
             sb.append(";");
             lines.add(sb.toString());