changeset 146:86d787cc5309

Defaults for WarmupMode.
author shade
date Tue, 27 Aug 2013 13:09:03 +0400
parents 917ec73e859d
children f8d3b5ff18ee
files jmh-core/src/main/java/org/openjdk/jmh/runner/options/HarnessOptions.java jmh-core/src/main/java/org/openjdk/jmh/runner/options/Options.java jmh-core/src/main/java/org/openjdk/jmh/runner/options/WarmupMode.java
diffstat 3 files changed, 17 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/options/HarnessOptions.java	Tue Aug 27 12:49:07 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/options/HarnessOptions.java	Tue Aug 27 13:09:03 2013 +0400
@@ -77,7 +77,7 @@
     protected List<String> excludes = new ArrayList<String>();
 
     @Option(name = "-wm", aliases = {"--warmupmode"}, usage = "Warmup mode for warming up selected micro benchmarks. Warmup modes are BeforeAny (measurements) or BeforeEach (measurement) (original mode)")
-    protected WarmupMode warmupMode = WarmupMode.BEFOREEACH;
+    protected WarmupMode warmupMode = WarmupMode.defaultMode();
 
     @Option(name = "-wmb", aliases = {"--warmupmicrobenchmarks"}, multiValued = true, metaVar = "REGEXP", usage = "Microbenchmarks to run for warmup before running any other benchmarks. These micros may be different from the target micros to warm up the harness or other parts of the JVM prior to running the target micro benchmarks. Regexp filtering out classes or methods which are MicroBenchmarks.")
     protected List<String> warmupMicros = new ArrayList<String>();
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/options/Options.java	Tue Aug 27 12:49:07 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/options/Options.java	Tue Aug 27 13:09:03 2013 +0400
@@ -125,7 +125,6 @@
 
     /**
      * Warmup mode.
-     * TODO: null for "default"
      * @return warmup mode
      */
     WarmupMode getWarmupMode();
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/options/WarmupMode.java	Tue Aug 27 12:49:07 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/options/WarmupMode.java	Tue Aug 27 13:09:03 2013 +0400
@@ -28,5 +28,20 @@
  * Warmup Mode enum
  */
 public enum WarmupMode {
-    BEFOREANY, BEFOREEACH
+
+    /**
+     * Warmup everything before any benchmark starts.
+     */
+    BEFOREANY,
+
+    /**
+     * Warmup each benchmark before benchmark starts.
+     */
+    BEFOREEACH,
+
+    ;
+
+    static WarmupMode defaultMode() {
+        return BEFOREEACH;
+    }
 }