changeset 194:b7403ff13303

New defaults: 10 forks, 20x1 sec warmup, 20x1 sec measurement. Saves the inexperienced people from the lot of trouble.
author shade
date Mon, 07 Oct 2013 14:50:07 +0400
parents f2babe7f11c0
children 7fcc14fb37a7
files jmh-core/src/main/java/org/openjdk/jmh/runner/options/CommandLineOptions.java jmh-core/src/main/java/org/openjdk/jmh/runner/parameters/BenchmarkParams.java jmh-core/src/main/java/org/openjdk/jmh/runner/parameters/Defaults.java
diffstat 3 files changed, 9 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/options/CommandLineOptions.java	Fri Sep 27 12:02:40 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/options/CommandLineOptions.java	Mon Oct 07 14:50:07 2013 +0400
@@ -77,7 +77,7 @@
     @Option(name = "-i", aliases = {"--iterations"}, metaVar = "INT", usage = "Number of iterations.")
     protected int iterations = -1;
 
-    @Option(name = "-r", aliases = {"--runtime"}, metaVar = "TIME", usage = "Run time for each iteration. Examples: 100s, 200ms; defaults to " + Defaults.ITERATION_TIME_SECS + "s", handler = TimeValueOptionHandler.class)
+    @Option(name = "-r", aliases = {"--runtime"}, metaVar = "TIME", usage = "Run time for each iteration. Examples: 100s, 200ms; defaults to " + Defaults.MEASUREMENT_TIME_SECS + "s", handler = TimeValueOptionHandler.class)
     protected TimeValue runTime = null;
 
     @Option(name = "-wi", aliases = {"--warmupiterations"}, metaVar = "INT", usage = "Number of warmup iterations to run.")
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/parameters/BenchmarkParams.java	Fri Sep 27 12:02:40 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/parameters/BenchmarkParams.java	Mon Oct 07 14:50:07 2013 +0400
@@ -77,7 +77,7 @@
                     timeValue = Defaults.WARMUP_TIME;
                 }
             }
-            return new IterationParams(getInteger(options.getWarmupIterations(), iters, Defaults.WARMUP_COUNT), timeValue, threads);
+            return new IterationParams(getInteger(options.getWarmupIterations(), iters, Defaults.WARMUP_ITERATION_COUNT), timeValue, threads);
         }
     }
 
@@ -101,7 +101,7 @@
                 }
             }
             return new IterationParams(
-                    getInteger(options.getIterations(), iters, Defaults.ITERATION_COUNT), timeValue, threads);
+                    getInteger(options.getIterations(), iters, Defaults.MEASUREMENT_ITERATION_COUNT), timeValue, threads);
         }
     }
 
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/parameters/Defaults.java	Fri Sep 27 12:02:40 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/parameters/Defaults.java	Mon Oct 07 14:50:07 2013 +0400
@@ -37,23 +37,21 @@
     public static final List<String> TRUE_VALUES  = Collections.unmodifiableList(Arrays.asList("true", "on", "yes"));
     public static final List<String> FALSE_VALUES = Collections.unmodifiableList(Arrays.asList("false", "off", "no"));
 
-    //--- has annotation
-    public static final int ITERATION_TIME_SECS = 5;  // seconds
-    public static final int ITERATION_COUNT = 20;
+    public static final int MEASUREMENT_TIME_SECS = 1;
+    public static final int MEASUREMENT_ITERATION_COUNT = 20;
     public static final int SINGLE_SHOT_ITERATION_COUNT = 1;
 
-    public static final int WARMUP_TIME_SECS = 3;     // seconds
-    public static final int WARMUP_COUNT = 5;
+    public static final int WARMUP_TIME_SECS = 1;
+    public static final int WARMUP_ITERATION_COUNT = 20;
     public static final int SINGLE_SHOT_WARMUP_COUNT = 0;
 
     public static final TimeValue WARMUP_TIME = new TimeValue(WARMUP_TIME_SECS, TimeUnit.SECONDS);
-    public static final TimeValue ITERATION_TIME = new TimeValue(ITERATION_TIME_SECS, TimeUnit.SECONDS);
+    public static final TimeValue ITERATION_TIME = new TimeValue(MEASUREMENT_TIME_SECS, TimeUnit.SECONDS);
 
     public static final int THREADS = 1;
 
-    public static final int DEFAULT_FORK_TIMES = 1;
+    public static final int DEFAULT_FORK_TIMES = 10;
 
-//--- no annotation
     public static final boolean SHOULD_SYNCH_ITERATIONS = true;
 
 }