<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[197498] trunk/PerformanceTests</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/197498">197498</a></dd>
<dt>Author</dt> <dd>jonlee@apple.com</dd>
<dt>Date</dt> <dd>2016-03-03 00:15:35 -0800 (Thu, 03 Mar 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add some new controllers, and refine tests
https://bugs.webkit.org/show_bug.cgi?id=154914

Reviewed by Simon Fraser.

Add a controller that centers around 30 fps instead of 60 fps.

* Animometer/developer.html: Add a new option.
* Animometer/resources/debug-runner/animometer.js:
* Animometer/resources/runner/animometer.js:
(this._processData.findRegression): When calculating the complexity-frameLength regression,
check the controller, and use a 30 fps baseline if needed.
* Animometer/resources/statistics.js:
(Regression.Utilities.createClass): Update to allow clients to specify the baseline
frame length.
* Animometer/tests/resources/main.js:
(tune): Override some of the constants in RampController. Move those constants out for
easier reading.

Add a fixed controller, with no step.

* Animometer/developer.html: Add a controller that takes no step.
* Animometer/resources/debug-runner/animometer.js:
* Animometer/tests/resources/main.js:
(Rotater.Utilities.createClass):

Switch to ramp controller as default.

* Animometer/developer.html: Increase the test length to 20 seconds.
* Animometer/resources/debug-runner/animometer.js: Rename the &quot;adjustment&quot; field to &quot;controller&quot;
since that is a more accurate description.
* Animometer/resources/debug-runner/graph.js:
* Animometer/resources/runner/animometer.js: Update preferences for release suite.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkPerformanceTestsAnimometerdeveloperhtml">trunk/PerformanceTests/Animometer/developer.html</a></li>
<li><a href="#trunkPerformanceTestsAnimometerresourcesdebugrunneranimometerjs">trunk/PerformanceTests/Animometer/resources/debug-runner/animometer.js</a></li>
<li><a href="#trunkPerformanceTestsAnimometerresourcesdebugrunnergraphjs">trunk/PerformanceTests/Animometer/resources/debug-runner/graph.js</a></li>
<li><a href="#trunkPerformanceTestsAnimometerresourcesrunneranimometerjs">trunk/PerformanceTests/Animometer/resources/runner/animometer.js</a></li>
<li><a href="#trunkPerformanceTestsAnimometerresourcesstatisticsjs">trunk/PerformanceTests/Animometer/resources/statistics.js</a></li>
<li><a href="#trunkPerformanceTestsAnimometertestsresourcesmainjs">trunk/PerformanceTests/Animometer/tests/resources/main.js</a></li>
<li><a href="#trunkPerformanceTestsChangeLog">trunk/PerformanceTests/ChangeLog</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkPerformanceTestsAnimometerdeveloperhtml"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/Animometer/developer.html (197497 => 197498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/Animometer/developer.html        2016-03-03 07:44:00 UTC (rev 197497)
+++ trunk/PerformanceTests/Animometer/developer.html        2016-03-03 08:15:35 UTC (rev 197498)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx">                     &lt;form name=&quot;benchmark-options&quot;&gt;
</span><span class="cx">                     &lt;ul&gt;
</span><span class="cx">                     &lt;li&gt;
</span><del>-                        &lt;label&gt;Test length: &lt;input type=&quot;number&quot; id=&quot;test-interval&quot; value=&quot;10&quot;&gt; seconds each&lt;/label&gt;
</del><ins>+                        &lt;label&gt;Test length: &lt;input type=&quot;number&quot; id=&quot;test-interval&quot; value=&quot;20&quot;&gt; seconds each&lt;/label&gt;
</ins><span class="cx">                     &lt;/li&gt;
</span><span class="cx">                     &lt;li&gt;
</span><span class="cx">                         &lt;h3&gt;Display:&lt;/h3&gt;
</span><span class="lines">@@ -47,9 +47,11 @@
</span><span class="cx">                     &lt;li&gt;
</span><span class="cx">                         &lt;h3&gt;Adjusting the test complexity:&lt;/h3&gt;
</span><span class="cx">                         &lt;ul&gt;
</span><del>-                            &lt;li&gt;&lt;label&gt;&lt;input name=&quot;adjustment&quot; type=&quot;radio&quot; value=&quot;step&quot;&gt; Keep at a fixed complexity, then make a big step&lt;/label&gt;&lt;/li&gt;
-                            &lt;li&gt;&lt;label&gt;&lt;input name=&quot;adjustment&quot; type=&quot;radio&quot; value=&quot;adaptive&quot; checked&gt; Maintain target FPS&lt;/label&gt;&lt;/li&gt;
-                            &lt;li&gt;&lt;label&gt;&lt;input name=&quot;adjustment&quot; type=&quot;radio&quot; value=&quot;ramp&quot;&gt; Ramp&lt;/label&gt;&lt;/li&gt;
</del><ins>+                            &lt;li&gt;&lt;label&gt;&lt;input name=&quot;controller&quot; type=&quot;radio&quot; value=&quot;fixed&quot;&gt; Keep at a fixed complexity&lt;/label&gt;&lt;/li&gt;
+                            &lt;li&gt;&lt;label&gt;&lt;input name=&quot;controller&quot; type=&quot;radio&quot; value=&quot;step&quot;&gt; Keep at a fixed complexity, then make a big step&lt;/label&gt;&lt;/li&gt;
+                            &lt;li&gt;&lt;label&gt;&lt;input name=&quot;controller&quot; type=&quot;radio&quot; value=&quot;adaptive&quot;&gt; Maintain target FPS&lt;/label&gt;&lt;/li&gt;
+                            &lt;li&gt;&lt;label&gt;&lt;input name=&quot;controller&quot; type=&quot;radio&quot; value=&quot;ramp&quot; checked&gt; Ramp&lt;/label&gt;&lt;/li&gt;
+                            &lt;li&gt;&lt;label&gt;&lt;input name=&quot;controller&quot; type=&quot;radio&quot; value=&quot;ramp30&quot;&gt; Ramp @ 30fps&lt;/label&gt;&lt;/li&gt;
</ins><span class="cx">                         &lt;/ul&gt;
</span><span class="cx">                     &lt;/li&gt;
</span><span class="cx">                     &lt;li&gt;
</span></span></pre></div>
<a id="trunkPerformanceTestsAnimometerresourcesdebugrunneranimometerjs"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/Animometer/resources/debug-runner/animometer.js (197497 => 197498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/Animometer/resources/debug-runner/animometer.js        2016-03-03 07:44:00 UTC (rev 197497)
+++ trunk/PerformanceTests/Animometer/resources/debug-runner/animometer.js        2016-03-03 08:15:35 UTC (rev 197498)
</span><span class="lines">@@ -328,7 +328,7 @@
</span><span class="cx">     updateEditsElementsState: function()
</span><span class="cx">     {
</span><span class="cx">         var editsElements = this._editsElements();
</span><del>-        var showComplexityInputs = optionsManager.valueForOption(&quot;adjustment&quot;) == &quot;step&quot;;
</del><ins>+        var showComplexityInputs = [&quot;fixed&quot;, &quot;step&quot;].indexOf(optionsManager.valueForOption(&quot;controller&quot;)) != -1;
</ins><span class="cx"> 
</span><span class="cx">         for (var i = 0; i &lt; editsElements.length; ++i) {
</span><span class="cx">             var editElement = editsElements[i];
</span><span class="lines">@@ -471,7 +471,7 @@
</span><span class="cx"> 
</span><span class="cx">     onBenchmarkOptionsChanged: function(event)
</span><span class="cx">     {
</span><del>-        if (event.target.name == &quot;adjustment&quot;) {
</del><ins>+        if (event.target.name == &quot;controller&quot;) {
</ins><span class="cx">             suitesManager.updateEditsElementsState();
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="lines">@@ -495,7 +495,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         var dashboard = benchmarkRunnerClient.results;
</span><del>-        if (dashboard.options[&quot;adjustment&quot;] == &quot;ramp&quot;)
</del><ins>+        if ([&quot;ramp&quot;, &quot;ramp30&quot;].indexOf(dashboard.options[&quot;controller&quot;]) != -1)
</ins><span class="cx">             Headers.details[3].disabled = true;
</span><span class="cx">         else {
</span><span class="cx">             Headers.details[1].disabled = true;
</span></span></pre></div>
<a id="trunkPerformanceTestsAnimometerresourcesdebugrunnergraphjs"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/Animometer/resources/debug-runner/graph.js (197497 => 197498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/Animometer/resources/debug-runner/graph.js        2016-03-03 07:44:00 UTC (rev 197497)
+++ trunk/PerformanceTests/Animometer/resources/debug-runner/graph.js        2016-03-03 08:15:35 UTC (rev 197498)
</span><span class="lines">@@ -368,7 +368,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // right-target
</span><del>-        if (options[&quot;adjustment&quot;] == &quot;adaptive&quot;) {
</del><ins>+        if (options[&quot;controller&quot;] == &quot;adaptive&quot;) {
</ins><span class="cx">             var targetFrameLength = 1000 / options[&quot;frame-rate&quot;];
</span><span class="cx">             svg.append(&quot;line&quot;)
</span><span class="cx">                 .attr(&quot;x1&quot;, x(0))
</span></span></pre></div>
<a id="trunkPerformanceTestsAnimometerresourcesrunneranimometerjs"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/Animometer/resources/runner/animometer.js (197497 => 197498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/Animometer/resources/runner/animometer.js        2016-03-03 07:44:00 UTC (rev 197497)
+++ trunk/PerformanceTests/Animometer/resources/runner/animometer.js        2016-03-03 08:15:35 UTC (rev 197498)
</span><span class="lines">@@ -60,6 +60,10 @@
</span><span class="cx">         data[Strings.json.result] = result;
</span><span class="cx">         var samples = data[Strings.json.samples];
</span><span class="cx"> 
</span><ins>+        var desiredFrameLength = 1000/60;
+        if (this._options[&quot;controller&quot;] == &quot;ramp30&quot;)
+            desiredFrameLength = 1000/30;
+
</ins><span class="cx">         function findRegression(series) {
</span><span class="cx">             var minIndex = Math.round(.025 * series.length);
</span><span class="cx">             var maxIndex = Math.round(.975 * (series.length - 1));
</span><span class="lines">@@ -80,7 +84,7 @@
</span><span class="cx">                     series,
</span><span class="cx">                     function (datum, i) { return datum[i].complexity; },
</span><span class="cx">                     function (datum, i) { return datum[i].frameLength; },
</span><del>-                    minIndex, maxIndex)
</del><ins>+                    minIndex, maxIndex, desiredFrameLength)
</ins><span class="cx">             };
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -107,7 +111,7 @@
</span><span class="cx">             regression[Strings.json.measurements.stdev] = Math.sqrt(calculation.error / samples[seriesName].length);
</span><span class="cx">         });
</span><span class="cx"> 
</span><del>-        if (this._options[&quot;adjustment&quot;] == &quot;ramp&quot;) {
</del><ins>+        if ([&quot;ramp&quot;, &quot;ramp30&quot;].indexOf(this._options[&quot;controller&quot;]) != -1) {
</ins><span class="cx">             var timeComplexity = new Experiment;
</span><span class="cx">             data[Strings.json.controller].forEach(function(regression) {
</span><span class="cx">                 timeComplexity.sample(regression[Strings.json.complexity]);
</span><span class="lines">@@ -364,10 +368,9 @@
</span><span class="cx">     startBenchmark: function()
</span><span class="cx">     {
</span><span class="cx">         var options = {
</span><del>-            &quot;test-interval&quot;: 10,
</del><ins>+            &quot;test-interval&quot;: 20,
</ins><span class="cx">             &quot;display&quot;: &quot;minimal&quot;,
</span><del>-            &quot;adjustment&quot;: &quot;adaptive&quot;,
-            &quot;frame-rate&quot;: 50,
</del><ins>+            &quot;controller&quot;: &quot;ramp&quot;,
</ins><span class="cx">             &quot;kalman-process-error&quot;: 1,
</span><span class="cx">             &quot;kalman-measurement-error&quot;: 4,
</span><span class="cx">             &quot;time-measurement&quot;: &quot;performance&quot;
</span></span></pre></div>
<a id="trunkPerformanceTestsAnimometerresourcesstatisticsjs"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/Animometer/resources/statistics.js (197497 => 197498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/Animometer/resources/statistics.js        2016-03-03 07:44:00 UTC (rev 197497)
+++ trunk/PerformanceTests/Animometer/resources/statistics.js        2016-03-03 08:15:35 UTC (rev 197498)
</span><span class="lines">@@ -148,16 +148,17 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> Regression = Utilities.createClass(
</span><del>-    function(samples, getComplexity, getFrameLength, startIndex, endIndex, options)
</del><ins>+    function(samples, getComplexity, getFrameLength, startIndex, endIndex, desiredFrameLength)
</ins><span class="cx">     {
</span><ins>+        desiredFrameLength = desiredFrameLength || 1000/60;
</ins><span class="cx">         var slope = this._calculateRegression(samples, getComplexity, getFrameLength, startIndex, endIndex, {
</span><span class="cx">             shouldClip: true,
</span><del>-            s1: 1000/60,
</del><ins>+            s1: desiredFrameLength,
</ins><span class="cx">             t1: 0
</span><span class="cx">         });
</span><span class="cx">         var flat = this._calculateRegression(samples, getComplexity, getFrameLength, startIndex, endIndex, {
</span><span class="cx">             shouldClip: true,
</span><del>-            s1: 1000/60,
</del><ins>+            s1: desiredFrameLength,
</ins><span class="cx">             t1: 0,
</span><span class="cx">             t2: 0
</span><span class="cx">         });
</span></span></pre></div>
<a id="trunkPerformanceTestsAnimometertestsresourcesmainjs"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/Animometer/tests/resources/main.js (197497 => 197498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/Animometer/tests/resources/main.js        2016-03-03 07:44:00 UTC (rev 197497)
+++ trunk/PerformanceTests/Animometer/tests/resources/main.js        2016-03-03 08:15:35 UTC (rev 197498)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx">         this._isFrameLengthEstimatorEnabled = true;
</span><span class="cx"> 
</span><span class="cx">         // Length of subsequent intervals; a value of 0 means use no intervals
</span><del>-        this._intervalLength = options[&quot;interval-length&quot;] || 100;
</del><ins>+        this.intervalSamplingLength = 100;
</ins><span class="cx"> 
</span><span class="cx">         this.initialComplexity = 0;
</span><span class="cx">     }, {
</span><span class="lines">@@ -97,7 +97,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         this._intervalStartIndex = sampleCount;
</span><del>-        this._intervalEndTimestamp = currentTimestamp + this._intervalLength;
</del><ins>+        this._intervalEndTimestamp = currentTimestamp + this.intervalSamplingLength;
</ins><span class="cx"> 
</span><span class="cx">         return averageFrameLength;
</span><span class="cx">     },
</span><span class="lines">@@ -109,7 +109,7 @@
</span><span class="cx"> 
</span><span class="cx">         var frameLengthEstimate = -1, intervalAverageFrameLength = -1;
</span><span class="cx">         var didFinishInterval = false;
</span><del>-        if (!this._intervalLength) {
</del><ins>+        if (!this.intervalSamplingLength) {
</ins><span class="cx">             if (this._isFrameLengthEstimatorEnabled) {
</span><span class="cx">                 this._frameLengthEstimator.sample(lastFrameLength);
</span><span class="cx">                 frameLengthEstimate = this._frameLengthEstimator.estimate;
</span><span class="lines">@@ -219,12 +219,21 @@
</span><span class="cx">     }
</span><span class="cx"> });
</span><span class="cx"> 
</span><ins>+FixedController = Utilities.createSubclass(Controller,
+    function(benchmark, options)
+    {
+        Controller.call(this, benchmark, options);
+        this.initialComplexity = options[&quot;complexity&quot;];
+        this.intervalSamplingLength = 0;
+    }
+);
+
</ins><span class="cx"> StepController = Utilities.createSubclass(Controller,
</span><span class="cx">     function(benchmark, options)
</span><span class="cx">     {
</span><del>-        options[&quot;interval-length&quot;] = 0;
</del><span class="cx">         Controller.call(this, benchmark, options);
</span><span class="cx">         this.initialComplexity = options[&quot;complexity&quot;];
</span><ins>+        this.intervalSamplingLength = 0;
</ins><span class="cx">         this._stepped = false;
</span><span class="cx">         this._stepTime = options[&quot;test-interval&quot;] / 2;
</span><span class="cx">     }, {
</span><span class="lines">@@ -318,12 +327,6 @@
</span><span class="cx">         this._tier = -.5;
</span><span class="cx">         // The timestamp is first set after the first interval completes
</span><span class="cx">         this._tierStartTimestamp = 0;
</span><del>-        // If the engine can handle the tier's complexity at 60 FPS, test for a short
-        // period, then move on to the next tier
-        this._tierFastTestLength = 250;
-        // If the engine is under stress, let the test run a little longer to let
-        // the measurement settle
-        this._tierSlowTestLength = 750;
</del><span class="cx">         this._minimumComplexity = 0;
</span><span class="cx">         this._maximumComplexity = 0;
</span><span class="cx"> 
</span><span class="lines">@@ -331,18 +334,10 @@
</span><span class="cx">         var minimumRampLength = 2500;
</span><span class="cx">         var totalRampIterations = Math.max(1, Math.floor(this._endTimestamp / minimumRampLength));
</span><span class="cx">         // Give a little extra room to run since the ramps won't be exactly this length
</span><del>-        this._rampLength = Math.floor((this._endTimestamp - totalRampIterations * this._intervalLength) / totalRampIterations);
-        this._rampWarmupLength = 200;
</del><ins>+        this._rampLength = Math.floor((this._endTimestamp - totalRampIterations * this.intervalSamplingLength) / totalRampIterations);
</ins><span class="cx">         this._rampDidWarmup = false;
</span><span class="cx">         this._rampRegressions = [];
</span><span class="cx"> 
</span><del>-        // Add some tolerance; frame lengths shorter than this are considered to be @ 60 fps
-        this._fps60Threshold = 1000/58;
-        // We are looking for the complexity that will get us at least as slow this threshold
-        this._fpsLowestThreshold = 1000/30;
-        // Try to make each ramp get this slow so that we can cross the break point
-        this._fpsRampSlowThreshold = 1000/45;
-
</del><span class="cx">         this._finishedTierSampling = false;
</span><span class="cx">         this._changePointEstimator = new Experiment;
</span><span class="cx">         this._minimumComplexityEstimator = new Experiment;
</span><span class="lines">@@ -350,6 +345,23 @@
</span><span class="cx">         this._intervalFrameLengthEstimator = new Experiment;
</span><span class="cx">     }, {
</span><span class="cx"> 
</span><ins>+    // If the engine can handle the tier's complexity at the desired frame rate, test for a short
+    // period, then move on to the next tier
+    tierFastTestLength: 250,
+    // If the engine is under stress, let the test run a little longer to let the measurement settle
+    tierSlowTestLength: 750,
+
+    rampWarmupLength: 200,
+
+    // Used for regression calculations in the ramps
+    frameLengthDesired: 1000/60,
+    // Add some tolerance; frame lengths shorter than this are considered to be @ the desired frame length
+    frameLengthDesiredThreshold: 1000/58,
+    // Represents the lower bound threshold in order to find the right complexity range to sample
+    frameLengthSlowestThreshold: 1000/30,
+    // Try to make each ramp get this slow so that we can cross the break point
+    frameLengthRampLowerThreshold: 1000/45,
+
</ins><span class="cx">     start: function(startTimestamp, stage)
</span><span class="cx">     {
</span><span class="cx">         Controller.prototype.start.call(this, startTimestamp, stage);
</span><span class="lines">@@ -359,14 +371,14 @@
</span><span class="cx">     didFinishInterval: function(timestamp, stage, intervalAverageFrameLength)
</span><span class="cx">     {
</span><span class="cx">         if (!this._finishedTierSampling) {
</span><del>-            if (this._tierStartTimestamp &gt; 0 &amp;&amp; timestamp &lt; this._tierStartTimestamp + this._tierFastTestLength)
</del><ins>+            if (this._tierStartTimestamp &gt; 0 &amp;&amp; timestamp &lt; this._tierStartTimestamp + this.tierFastTestLength)
</ins><span class="cx">                 return;
</span><span class="cx"> 
</span><span class="cx">             var currentComplexity = stage.complexity();
</span><span class="cx">             var currentFrameLength = this._frameLengthEstimator.estimate;
</span><del>-            if (currentFrameLength &lt; this._fpsLowestThreshold) {
-                var isAnimatingAt60FPS = currentFrameLength &lt; this._fps60Threshold;
-                var hasFinishedSlowTierTest = timestamp &gt; this._tierStartTimestamp + this._tierSlowTestLength;
</del><ins>+            if (currentFrameLength &lt; this.frameLengthSlowestThreshold) {
+                var isAnimatingAt60FPS = currentFrameLength &lt; this.frameLengthDesiredThreshold;
+                var hasFinishedSlowTierTest = timestamp &gt; this._tierStartTimestamp + this.tierSlowTestLength;
</ins><span class="cx"> 
</span><span class="cx">                 if (!isAnimatingAt60FPS &amp;&amp; !hasFinishedSlowTierTest)
</span><span class="cx">                     return;
</span><span class="lines">@@ -387,7 +399,7 @@
</span><span class="cx">                     this.mark(&quot;Complexity: &quot; + nextTierComplexity, timestamp);
</span><span class="cx">                     return;
</span><span class="cx">                 }
</span><del>-            } else if (timestamp &lt; this._tierStartTimestamp + this._tierSlowTestLength)
</del><ins>+            } else if (timestamp &lt; this._tierStartTimestamp + this.tierSlowTestLength)
</ins><span class="cx">                 return;
</span><span class="cx"> 
</span><span class="cx">             this._finishedTierSampling = true;
</span><span class="lines">@@ -405,7 +417,7 @@
</span><span class="cx">             // Avoid going down that far since it means fewer measurements are taken in the 60 fps area
</span><span class="cx">             // Interpolate a maximum complexity that gets us around the lowest threshold
</span><span class="cx">             if (this._lastTierComplexity != currentComplexity)
</span><del>-                this._maximumComplexity = Math.floor(Utilities.lerp(Utilities.progressValue(this._fpsLowestThreshold, this._lastTierFrameLength, currentFrameLength), this._lastTierComplexity, currentComplexity));
</del><ins>+                this._maximumComplexity = Math.floor(Utilities.lerp(Utilities.progressValue(this.frameLengthSlowestThreshold, this._lastTierFrameLength, currentFrameLength), this._lastTierComplexity, currentComplexity));
</ins><span class="cx">             else {
</span><span class="cx">                 // If the browser is capable of handling the most complex version of the test, use that
</span><span class="cx">                 this._maximumComplexity = currentComplexity;
</span><span class="lines">@@ -425,7 +437,7 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if ((timestamp - this._rampStartTimestamp) &lt; this._rampWarmupLength)
</del><ins>+        if ((timestamp - this._rampStartTimestamp) &lt; this.rampWarmupLength)
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         if (this._rampDidWarmup)
</span><span class="lines">@@ -451,14 +463,14 @@
</span><span class="cx">         var intervalFrameLengthMean = this._intervalFrameLengthEstimator.mean();
</span><span class="cx">         var intervalFrameLengthStandardDeviation = this._intervalFrameLengthEstimator.standardDeviation();
</span><span class="cx"> 
</span><del>-        if (intervalFrameLengthMean &lt; this._fps60Threshold &amp;&amp; this._intervalFrameLengthEstimator.cdf(this._fps60Threshold) &gt; .95) {
</del><ins>+        if (intervalFrameLengthMean &lt; this.frameLengthDesiredThreshold &amp;&amp; this._intervalFrameLengthEstimator.cdf(this.frameLengthDesiredThreshold) &gt; .95) {
</ins><span class="cx">             this._possibleMinimumComplexity = Math.max(this._possibleMinimumComplexity, currentComplexity);
</span><span class="cx">         } else if (intervalFrameLengthStandardDeviation &gt; 2) {
</span><span class="cx">             // In the case where we might have found a previous interval where 60fps was reached. We hit a significant blip,
</span><span class="cx">             // so we should resample this area in the next ramp.
</span><span class="cx">             this._possibleMinimumComplexity = 0;
</span><span class="cx">         }
</span><del>-        if (intervalFrameLengthMean - intervalFrameLengthStandardDeviation &gt; this._fpsRampSlowThreshold)
</del><ins>+        if (intervalFrameLengthMean - intervalFrameLengthStandardDeviation &gt; this.frameLengthRampLowerThreshold)
</ins><span class="cx">             this._possibleMaximumComplexity = Math.min(this._possibleMaximumComplexity, currentComplexity);
</span><span class="cx">         this._intervalFrameLengthEstimator.reset();
</span><span class="cx"> 
</span><span class="lines">@@ -470,12 +482,12 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         var regression = new Regression(this._sampler.samples, this._getComplexity, this._getFrameLength,
</span><del>-            this._sampler.sampleCount - 1, this._rampStartIndex);
</del><ins>+            this._sampler.sampleCount - 1, this._rampStartIndex, this.frameLengthDesired);
</ins><span class="cx">         this._rampRegressions.push(regression);
</span><span class="cx"> 
</span><span class="cx">         var interpolatedFrameLength = regression.valueAt(this._maximumComplexity);
</span><del>-        if (interpolatedFrameLength &lt; this._fpsRampSlowThreshold)
-            this._possibleMaximumComplexity = Math.floor(Utilities.lerp(Utilities.progressValue(this._fpsRampSlowThreshold, interpolatedFrameLength, this._lastTierFrameLength), this._maximumComplexity, this._lastTierComplexity));
</del><ins>+        if (interpolatedFrameLength &lt; this.frameLengthRampLowerThreshold)
+            this._possibleMaximumComplexity = Math.floor(Utilities.lerp(Utilities.progressValue(this.frameLengthRampLowerThreshold, interpolatedFrameLength, this._lastTierFrameLength), this._maximumComplexity, this._lastTierComplexity));
</ins><span class="cx"> 
</span><span class="cx">         interpolatedFrameLength = regression.valueAt(this._minimumComplexity);
</span><span class="cx">         this._minimumComplexityEstimator.sample(this._possibleMinimumComplexity);
</span><span class="lines">@@ -557,6 +569,18 @@
</span><span class="cx">     }
</span><span class="cx"> });
</span><span class="cx"> 
</span><ins>+Ramp30Controller = Utilities.createSubclass(RampController,
+    function(benchmark, options)
+    {
+        RampController.call(this, benchmark, options);
+    }, {
+
+    frameLengthDesired: 1000/30,
+    frameLengthDesiredThreshold: 1000/29,
+    frameLengthSlowestThreshold: 1000/20,
+    frameLengthRampLowerThreshold: 1000/20
+});
+
</ins><span class="cx"> Stage = Utilities.createClass(
</span><span class="cx">     function()
</span><span class="cx">     {
</span><span class="lines">@@ -674,7 +698,7 @@
</span><span class="cx">           'color',
</span><span class="cx">           'luminosity'
</span><span class="cx">         ];
</span><del>-        
</del><ins>+
</ins><span class="cx">         return mixBlendModeList[this.randomInt(0, mixBlendModeList.length)];
</span><span class="cx">     },
</span><span class="cx"> 
</span><span class="lines">@@ -692,7 +716,7 @@
</span><span class="cx">             'blur(10px)',
</span><span class="cx">             'drop-shadow(10px 10px 10px gray)'
</span><span class="cx">         ];
</span><del>-        
</del><ins>+
</ins><span class="cx">         return filterList[this.randomInt(0, filterList.length)];
</span><span class="cx">     },
</span><span class="cx"> 
</span><span class="lines">@@ -775,8 +799,11 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         options[&quot;test-interval&quot;] *= 1000;
</span><del>-        switch (options[&quot;adjustment&quot;])
</del><ins>+        switch (options[&quot;controller&quot;])
</ins><span class="cx">         {
</span><ins>+        case &quot;fixed&quot;:
+            this._controller = new FixedController(this, options);
+            break;
</ins><span class="cx">         case &quot;step&quot;:
</span><span class="cx">             this._controller = new StepController(this, options);
</span><span class="cx">             break;
</span><span class="lines">@@ -786,6 +813,8 @@
</span><span class="cx">         case &quot;ramp&quot;:
</span><span class="cx">             this._controller = new RampController(this, options);
</span><span class="cx">             break;
</span><ins>+        case &quot;ramp30&quot;:
+            this._controller = new Ramp30Controller(this, options);
</ins><span class="cx">         }
</span><span class="cx">     }, {
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkPerformanceTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/ChangeLog (197497 => 197498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/ChangeLog        2016-03-03 07:44:00 UTC (rev 197497)
+++ trunk/PerformanceTests/ChangeLog        2016-03-03 08:15:35 UTC (rev 197498)
</span><span class="lines">@@ -1,3 +1,39 @@
</span><ins>+2016-03-02  Jon Lee  &lt;jonlee@apple.com&gt;
+
+        Add some new controllers, and refine tests
+        https://bugs.webkit.org/show_bug.cgi?id=154914
+
+        Reviewed by Simon Fraser.
+
+        Add a controller that centers around 30 fps instead of 60 fps.
+
+        * Animometer/developer.html: Add a new option.
+        * Animometer/resources/debug-runner/animometer.js:
+        * Animometer/resources/runner/animometer.js:
+        (this._processData.findRegression): When calculating the complexity-frameLength regression,
+        check the controller, and use a 30 fps baseline if needed.
+        * Animometer/resources/statistics.js:
+        (Regression.Utilities.createClass): Update to allow clients to specify the baseline
+        frame length.
+        * Animometer/tests/resources/main.js:
+        (tune): Override some of the constants in RampController. Move those constants out for
+        easier reading.
+
+        Add a fixed controller, with no step.
+
+        * Animometer/developer.html: Add a controller that takes no step.
+        * Animometer/resources/debug-runner/animometer.js:
+        * Animometer/tests/resources/main.js:
+        (Rotater.Utilities.createClass):
+
+        Switch to ramp controller as default.
+
+        * Animometer/developer.html: Increase the test length to 20 seconds.
+        * Animometer/resources/debug-runner/animometer.js: Rename the &quot;adjustment&quot; field to &quot;controller&quot;
+        since that is a more accurate description.
+        * Animometer/resources/debug-runner/graph.js:
+        * Animometer/resources/runner/animometer.js: Update preferences for release suite.
+
</ins><span class="cx"> 2016-02-26  Jon Lee  &lt;jonlee@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Address Dean's comments in 154673.
</span></span></pre>
</div>
</div>

</body>
</html>