Address Said's comments on the benchmark, and do some clean up.
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Feb 2016 05:26:20 +0000 (05:26 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Feb 2016 05:26:20 +0000 (05:26 +0000)
* Animometer/developer.html:
* Animometer/resources/debug-runner/animometer.css: Add styles for averages.
* Animometer/resources/debug-runner/animometer.js: Use the right
Strings constants.
* Animometer/resources/debug-runner/graph.js:
(_addRegressionLine): Add missing code to draw the line and standard
deviation highlight.
(onGraphTypeChanged): Remove unneeded variables
(onTimeGraphOptionsChanged):
* Animometer/resources/runner/benchmark-runner.js:
(_runBenchmarkAndRecordResults): Rename samplers to suiteResults and
_suitesSamplers to _suitesResults.
* Animometer/tests/resources/main.js:
(results): Call processSamples().
(update): Change sampling timestamp comparison.
(_animateLoop): Move shouldStop call to before the update.
* Animometer/tests/resources/sampler.js:
(process): Rename to processSamples().

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

PerformanceTests/Animometer/resources/debug-runner/animometer.css
PerformanceTests/Animometer/resources/debug-runner/animometer.js
PerformanceTests/Animometer/resources/debug-runner/graph.js
PerformanceTests/Animometer/resources/runner/benchmark-runner.js
PerformanceTests/Animometer/tests/resources/main.js
PerformanceTests/Animometer/tests/resources/sampler.js
PerformanceTests/ChangeLog

index 18fb94e..6b81ad8 100644 (file)
@@ -411,9 +411,13 @@ label.tree-label {
     fill: #999;
 }
 
-.left-mean {
-    stroke: #7ADD49;
-    opacity: .8;
+.mean.complexity line {
+    stroke: hsla(100, 69%, 58%, .8);
+    stroke-width: 2px;
+}
+
+.mean.complexity polygon {
+    fill: hsla(100, 69%, 58%, .1);
 }
 
 .target-fps {
@@ -422,17 +426,22 @@ label.tree-label {
     stroke-dasharray: 10, 10;
 }
 
-.right-mean {
-    stroke: #FA4925;
-    opacity: .8;
+.mean.fps line {
+    stroke: hsla(10, 96%, 56%, .8);
+    stroke-width: 2px;
+}
+
+.mean.fps polygon {
+    fill: hsla(10, 96%, 56%, .1);
 }
 
-#cursor line {
+.cursor line {
     stroke: rgb(250, 250, 250);
     stroke-width: 1px;
 }
 
-#cursor circle {
+.cursor circle,
+.cursor text {
     fill: rgb(250, 250, 250);
 }
 
index 7f740ae..e2c62af 100644 (file)
@@ -35,7 +35,7 @@ DeveloperResultsTable = Utilities.createSubclass(ResultsTable,
 
         button.addEventListener("click", function() {
             var graphData = {
-                axes: [Strings.text.complexity, Strings.text.frameRate],
+                axes: [Strings.text.experiments.complexity, Strings.text.experiments.frameRate],
                 samples: data,
                 complexityAverageSamples: testResults[Strings.json.complexityAverageSamples],
                 averages: {},
@@ -48,9 +48,6 @@ DeveloperResultsTable = Utilities.createSubclass(ResultsTable,
 
             [
                 Strings.json.score,
-                Strings.json.regressions.timeRegressions,
-                Strings.json.regressions.complexityRegression,
-                Strings.json.regressions.complexityAverageRegression,
                 Strings.json.targetFrameLength
             ].forEach(function(key) {
                 if (testResults[key])
@@ -60,7 +57,7 @@ DeveloperResultsTable = Utilities.createSubclass(ResultsTable,
             benchmarkController.showTestGraph(testName, graphData);
         });
 
-        button.textContent = Strings.text.graph + "...";
+        button.textContent = Strings.text.results.graph + "...";
     },
 
     _isNoisyMeasurement: function(jsonExperiment, data, measurement, options)
@@ -108,7 +105,7 @@ DeveloperResultsTable = Utilities.createSubclass(ResultsTable,
             }
 
             var td = Utilities.createElement("td", { class: className }, row);
-            if (header.title == Strings.text.graph) {
+            if (header.title == Strings.text.results.graph) {
                 this._addGraphButton(td, testName, testResults);
             } else if (!("text" in header)) {
                 td.textContent = testResults[header.title];
index 3384d42..b386eed 100644 (file)
@@ -17,6 +17,30 @@ Utilities.extendObject(window.benchmarkController, {
         this.onGraphTypeChanged();
     },
 
+    _addRegressionLine: function(parent, xScale, yScale, points, stdev, isAlongYAxis)
+    {
+        var polygon = [];
+        var line = []
+        var xStdev = isAlongYAxis ? stdev : 0;
+        var yStdev = isAlongYAxis ? 0 : stdev;
+        for (var i = 0; i < points.length; ++i) {
+            var point = points[i];
+            polygon.push(xScale(point[0] + xStdev), yScale(point[1] + yStdev));
+            line.push(xScale(point[0]), yScale(point[1]));
+        }
+        for (var i = points.length - 1; i >= 0; --i) {
+            var point = points[i];
+            polygon.push(xScale(point[0] - xStdev), yScale(point[1] - yStdev));
+        }
+        parent.append("polygon")
+            .attr("points", polygon.join(","));
+        parent.append("line")
+            .attr("x1", line[0])
+            .attr("y1", line[1])
+            .attr("x2", line[2])
+            .attr("y2", line[3]);
+    },
+
     createTimeGraph: function(graphData, margins, size)
     {
         var svg = d3.select("#test-graph-data").append("svg")
@@ -130,13 +154,9 @@ Utilities.extendObject(window.benchmarkController, {
         }
         if (Strings.json.experiments.frameRate in graphData.averages) {
             var frameRate = graphData.averages[Strings.json.experiments.frameRate];
-            var average = yRight(1000/frameRate.average);
-            svg.append("line")
-                .attr("x1", x(0))
-                .attr("x2", size.width)
-                .attr("y1", average)
-                .attr("y2", average)
+            var regression = svg.append("g")
                 .attr("class", "fps mean");
+            this._addRegressionLine(regression, x, yRight, [[graphData.samples[0].time, 1000/frameRate.average], [graphData.samples[graphData.samples.length - 1].time, 1000/frameRate.average]], frameRate.stdev);
         }
 
         // right-target
@@ -278,13 +298,11 @@ Utilities.extendObject(window.benchmarkController, {
         benchmarkController._showOrHideNodes(form["complexity"].checked, "#complexity");
         benchmarkController._showOrHideNodes(form["rawFPS"].checked, "#rawFPS");
         benchmarkController._showOrHideNodes(form["filteredFPS"].checked, "#filteredFPS");
-        benchmarkController._showOrHideNodes(form["regressions"].checked, "#regressions");
     },
 
     onGraphTypeChanged: function() {
-        var form = document.forms["graph-type"].elements;
         var graphData = document.getElementById("test-graph-data").graphData;
-        var isTimeSelected = true; 
+        var isTimeSelected = true;
 
         benchmarkController._showOrHideNodes(isTimeSelected, "#time-graph");
         benchmarkController._showOrHideNodes(isTimeSelected, "form[name=time-graph-options]");
index 21bc008..b6a82be 100644 (file)
@@ -95,9 +95,9 @@ BenchmarkRunner = Utilities.createClass(
 
         var benchmark = new contentWindow.benchmarkClass(options);
         benchmark.run().then(function(results) {
-            var samplers = self._suitesSamplers[suite.name] || {};
-            samplers[test.name] = results;
-            self._suitesSamplers[suite.name] = samplers;
+            var suiteResults = self._suitesResults[suite.name] || {};
+            suiteResults[test.name] = results;
+            self._suitesResults[suite.name] = suiteResults;
 
             if (self._client && self._client.didRunTest)
                 self._client.didRunTest(suite, test);
@@ -115,7 +115,7 @@ BenchmarkRunner = Utilities.createClass(
     {
         if (!state) {
             state = new BenchmarkRunnerState(this._suites);
-            this._suitesSamplers = {};
+            this._suitesResults = {};
         }
 
         var suite = state.currentSuite();
@@ -168,7 +168,7 @@ BenchmarkRunner = Utilities.createClass(
         this._removeFrame();
 
         if (this._client && this._client.didRunSuites)
-            this._client.didRunSuites(this._suitesSamplers);
+            this._client.didRunSuites(this._suitesResults);
 
         if (this._runNextIteration)
             this._runNextIteration();
index 1a306f5..056ff7b 100644 (file)
@@ -102,7 +102,7 @@ Controller = Utilities.createClass(
 
     results: function()
     {
-        return this._sampler.process();
+        return this._sampler.processSamples();
     },
 
     processSamples: function(results)
@@ -223,7 +223,7 @@ AdaptiveController = Utilities.createSubclass(Controller,
 
     update: function(timestamp, stage)
     {
-        if (!this._startedSampling && timestamp > this._samplingTimestamp) {
+        if (!this._startedSampling && timestamp >= this._samplingTimestamp) {
             this._startedSampling = true;
             this.mark(Strings.json.samplingStartTimeOffset, this._samplingTimestamp);
         }
@@ -470,6 +470,11 @@ Benchmark = Utilities.createClass(
     {
         this._currentTimestamp = this._getTimestamp();
 
+        if (this._controller.shouldStop(this._currentTimestamp)) {
+            this._finishPromise.resolve(this._controller.results());
+            return;
+        }
+
         if (!this._didWarmUp) {
             if (this._currentTimestamp - this._previousTimestamp >= 100) {
                 this._didWarmUp = true;
@@ -483,11 +488,6 @@ Benchmark = Utilities.createClass(
         }
 
         this._controller.update(this._currentTimestamp, this._stage);
-        if (this._controller.shouldStop(this._currentTimestamp)) {
-            this._finishPromise.resolve(this._controller.results());
-            return;
-        }
-
         this._stage.animate(this._currentTimestamp - this._previousTimestamp);
         this._previousTimestamp = this._currentTimestamp;
         requestAnimationFrame(this._animateLoop);
index 2d7d0b9..56335b1 100644 (file)
@@ -72,7 +72,7 @@ Sampler = Utilities.createClass(
         ++this.sampleCount;
     },
 
-    process: function()
+    processSamples: function()
     {
         var results = {};
 
index 6d49f07..10724fd 100644 (file)
@@ -1,3 +1,26 @@
+2016-02-08  Jon Lee  <jonlee@apple.com>
+
+        Address Said's comments on the benchmark, and do some clean up.
+
+        * Animometer/developer.html:
+        * Animometer/resources/debug-runner/animometer.css: Add styles for averages.
+        * Animometer/resources/debug-runner/animometer.js: Use the right
+        Strings constants.
+        * Animometer/resources/debug-runner/graph.js:
+        (_addRegressionLine): Add missing code to draw the line and standard
+        deviation highlight.
+        (onGraphTypeChanged): Remove unneeded variables
+        (onTimeGraphOptionsChanged):
+        * Animometer/resources/runner/benchmark-runner.js:
+        (_runBenchmarkAndRecordResults): Rename samplers to suiteResults and
+        _suitesSamplers to _suitesResults.
+        * Animometer/tests/resources/main.js:
+        (results): Call processSamples().
+        (update): Change sampling timestamp comparison.
+        (_animateLoop): Move shouldStop call to before the update.
+        * Animometer/tests/resources/sampler.js:
+        (process): Rename to processSamples().
+
 2016-02-07  Jon Lee  <jonlee@apple.com>
 
         Teach Controller to measure intervals, and turn off the frame length estimator.