Allow the ramp controller to run tests that take less time than the initial ramp...
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Jun 2018 00:45:34 +0000 (00:45 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Jun 2018 00:45:34 +0000 (00:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=186257

Reviewed by Said Abou-Hallawa.

* MotionMark/tests/resources/main.js: Extend the desired end timestamp when ramp-up occurs.
Previously the controller assumed that the duration of the test was always longer than the
time it took to figure out the order of magnitude of particles to render. When that range
is determined, the end timestamp is then extended. If the duration is too short, the controller
would throw an exception. The fix is to continue extending the timestamp every time the order of
magnitude tiers up.

In general testing with really short durations isn't practical, but sometimes it is
desired for debugging.

To avoid confusion of the private variables, I renamed Benchmark._startTimestamp to
Benchmark._benchmarkStartTimestamp, to disambiguate from Controller._startTimestamp.
Benchmark._startTimestamp is set once and never changed, after the initial 100ms warm-up.
Controller._startTimestamp is initialized to 0 (which means "not initialized"), and then after
the warm up is complete, set in Controller.start() to the same wall clock timestamp, and never
changed afterwards.

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

PerformanceTests/ChangeLog
PerformanceTests/MotionMark/tests/resources/main.js

index 32b7867..3a9eb45 100644 (file)
@@ -1,5 +1,29 @@
 2018-06-06  Jon Lee  <jonlee@apple.com>
 
+        Allow the ramp controller to run tests that take less time than the initial ramp-up phase
+        https://bugs.webkit.org/show_bug.cgi?id=186257
+
+        Reviewed by Said Abou-Hallawa.
+
+        * MotionMark/tests/resources/main.js: Extend the desired end timestamp when ramp-up occurs.
+        Previously the controller assumed that the duration of the test was always longer than the
+        time it took to figure out the order of magnitude of particles to render. When that range
+        is determined, the end timestamp is then extended. If the duration is too short, the controller
+        would throw an exception. The fix is to continue extending the timestamp every time the order of
+        magnitude tiers up.
+
+        In general testing with really short durations isn't practical, but sometimes it is
+        desired for debugging.
+
+        To avoid confusion of the private variables, I renamed Benchmark._startTimestamp to
+        Benchmark._benchmarkStartTimestamp, to disambiguate from Controller._startTimestamp.
+        Benchmark._startTimestamp is set once and never changed, after the initial 100ms warm-up.
+        Controller._startTimestamp is initialized to 0 (which means "not initialized"), and then after
+        the warm up is complete, set in Controller.start() to the same wall clock timestamp, and never
+        changed afterwards.
+
+2018-06-06  Jon Lee  <jonlee@apple.com>
+
         Remove unneeded data processing in MotionMark
         https://bugs.webkit.org/show_bug.cgi?id=186256
 
index bfeefdf..5c3bbdf 100644 (file)
@@ -314,6 +314,8 @@ RampController = Utilities.createSubclass(Controller,
         this._minimumComplexity = 1;
         this._maximumComplexity = 1;
 
+        this._testLength = options["test-interval"];
+
         // After the tier range is determined, figure out the number of ramp iterations
         var minimumRampLength = 3000;
         var totalRampIterations = Math.max(1, Math.floor(this._endTimestamp / minimumRampLength));
@@ -377,6 +379,7 @@ RampController = Utilities.createSubclass(Controller,
                 this._lastTierFrameLength = currentFrameLength;
 
                 this._tier += .5;
+                this._endTimestamp = timestamp + this._testLength;
                 var nextTierComplexity = Math.round(Math.pow(10, this._tier));
                 stage.tune(nextTierComplexity - currentComplexity);
 
@@ -394,7 +397,7 @@ RampController = Utilities.createSubclass(Controller,
             this.intervalSamplingLength = 120;
 
             // Extend the test length so that the full test length is made of the ramps
-            this._endTimestamp += timestamp;
+            this._endTimestamp = timestamp + this._testLength;
             this.mark(Strings.json.samplingStartTimeOffset, timestamp);
 
             this._minimumComplexity = 1;
@@ -823,7 +826,7 @@ Benchmark = Utilities.createClass(
 
     get timestamp()
     {
-        return this._currentTimestamp - this._startTimestamp;
+        return this._currentTimestamp - this._benchmarkStartTimestamp;
     },
 
     backgroundColor: function()
@@ -867,7 +870,7 @@ Benchmark = Utilities.createClass(
                 this._previousTimestamp = timestamp;
             else if (timestamp - this._previousTimestamp >= 100) {
                 this._didWarmUp = true;
-                this._startTimestamp = timestamp;
+                this._benchmarkStartTimestamp = timestamp;
                 this._controller.start(timestamp, this._stage);
                 this._previousTimestamp = timestamp;
             }