Make the fixed controller a step controller instead. Halfway through the test
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Feb 2016 03:30:32 +0000 (03:30 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Feb 2016 03:30:32 +0000 (03:30 +0000)
it will bump up the complexity 4-fold. Calculate the step timestamp using options
instead of a separate parameter to the Controller constructor.

* Animometer/developer.html: Change value to "step"
* Animometer/resources/debug-runner/animometer.js:
(window.suitesManager.updateEditsElementsState): Show number inputs when set to "step".
* Animometer/tests/resources/main.js:
(update): Provide a hook for subclasses to tune.
(StepController): Maintain a flag determining whether we've stepped, and the time
we should step.
(Benchmark): Use the new StepController.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196293 268f45cc-cd09-0410-ab3c-d52691b4dbfc

PerformanceTests/Animometer/developer.html
PerformanceTests/Animometer/resources/debug-runner/animometer.js
PerformanceTests/Animometer/tests/resources/main.js
PerformanceTests/ChangeLog

index 51f2bac..0dfdf67 100644 (file)
@@ -44,7 +44,7 @@
                     <li>
                         <h3>Adjusting the test complexity:</h3>
                         <ul>
-                            <li><label><input name="adjustment" type="radio" value="fixed"> Keep at a fixed complexity</label></li>
+                            <li><label><input name="adjustment" type="radio" value="step"> Keep at a fixed complexity, then make a big step</label></li>
                             <li><label><input name="adjustment" type="radio" value="adaptive" checked> Maintain target FPS</label></li>
                         </ul>
                     </li>
index 7625908..8f2fd36 100644 (file)
@@ -241,7 +241,7 @@ window.suitesManager =
     updateEditsElementsState: function()
     {
         var editsElements = this._editsElements();
-        var showComplexityInputs = optionsManager.valueForOption("adjustment") == "fixed";
+        var showComplexityInputs = optionsManager.valueForOption("adjustment") == "step";
 
         for (var i = 0; i < editsElements.length; ++i) {
             var editElement = editsElements[i];
index 74624f1..3011e8f 100644 (file)
@@ -1,12 +1,12 @@
 Controller = Utilities.createClass(
-    function(testLength, benchmark, options)
+    function(benchmark, options)
     {
         // Initialize timestamps relative to the start of the benchmark
         // In start() the timestamps are offset by the start timestamp
         this._startTimestamp = 0;
-        this._endTimestamp = testLength;
+        this._endTimestamp = options["test-interval"];
         // Default data series: timestamp, complexity, estimatedFrameLength
-        this._sampler = new Sampler(options["series-count"] || 3, 60 * testLength, this);
+        this._sampler = new Sampler(options["series-count"] || 3, (60 * options["test-interval"] / 1000), this);
         this._estimator = new SimpleKalmanEstimator(options["kalman-process-error"], options["kalman-measurement-error"]);
         this._marks = {};
 
@@ -41,6 +41,12 @@ Controller = Utilities.createClass(
     {
         this._estimator.sample(timestamp - this._sampler.samples[0][this._sampler.sampleCount - 1]);
         this._sampler.record(timestamp, stage.complexity(), this._estimator.estimate);
+
+        this.tune(stage, timestamp);
+    },
+
+    tune: function(stage, timestamp)
+    {
     },
 
     shouldStop: function(timestamp)
@@ -113,22 +119,40 @@ Controller = Utilities.createClass(
     }
 });
 
-FixedComplexityController = Utilities.createSubclass(Controller,
-    function(testInterval, benchmark, options)
+StepController = Utilities.createSubclass(Controller,
+    function(benchmark, options)
     {
-        Controller.call(this, testInterval, benchmark, options);
+        Controller.call(this, benchmark, options);
         this.initialComplexity = options["complexity"];
+        this._stepped = false;
+        this._stepTime = options["test-interval"] / 2;
+    }, {
+
+    start: function(stage, startTimestamp)
+    {
+        Controller.prototype.start.call(this, stage, startTimestamp);
+        this._stepTime += startTimestamp;
+    },
+
+    tune: function(stage, timestamp)
+    {
+        if (this._stepped || timestamp < this._stepTime)
+            return;
+
+        this.mark(Strings.json.samplingEndTimeOffset, timestamp);
+        this._stepped = true;
+        stage.tune(stage.complexity() * 3);
     }
-);
+});
 
 AdaptiveController = Utilities.createSubclass(Controller,
-    function(testInterval, benchmark, options)
+    function(benchmark, options)
     {
         // Data series: timestamp, complexity, estimatedIntervalFrameLength
-        Controller.call(this, testInterval, benchmark, options);
+        Controller.call(this, benchmark, options);
 
         // All tests start at 0, so we expect to see 60 fps quickly.
-        this._samplingTimestamp = testInterval / 2;
+        this._samplingTimestamp = options["test-interval"] / 2;
         this._startedSampling = false;
         this._targetFrameRate = options["frame-rate"];
         this._pid = new PIDController(this._targetFrameRate);
@@ -337,15 +361,15 @@ Benchmark = Utilities.createClass(
             break;
         }
 
-        var testIntervalMilliseconds = options["test-interval"] * 1000;
+        options["test-interval"] *= 1000;
         switch (options["adjustment"])
         {
-        case "fixed":
-            this._controller = new FixedComplexityController(testIntervalMilliseconds, this, options);
+        case "step":
+            this._controller = new StepController(this, options);
             break;
         case "adaptive":
         default:
-            this._controller = new AdaptiveController(testIntervalMilliseconds, this, options);
+            this._controller = new AdaptiveController(this, options);
             break;
         }
     }, {
index 4a8956f..29c8e19 100644 (file)
@@ -1,5 +1,20 @@
 2016-02-07  Jon Lee  <jonlee@apple.com>
 
+        Make the fixed controller a step controller instead. Halfway through the test
+        it will bump up the complexity 4-fold. Calculate the step timestamp using options
+        instead of a separate parameter to the Controller constructor.
+
+        * Animometer/developer.html: Change value to "step"
+        * Animometer/resources/debug-runner/animometer.js:
+        (window.suitesManager.updateEditsElementsState): Show number inputs when set to "step".
+        * Animometer/tests/resources/main.js:
+        (update): Provide a hook for subclasses to tune.
+        (StepController): Maintain a flag determining whether we've stepped, and the time
+        we should step.
+        (Benchmark): Use the new StepController.
+
+2016-02-07  Jon Lee  <jonlee@apple.com>
+
         Adjust the FPS graph scale.
 
         Instead of making the FPS graph linearly scale, scale it based on the frame length,