Update benchmark test suite
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Jan 2016 03:58:33 +0000 (03:58 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Jan 2016 03:58:33 +0000 (03:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=152679

Reviewed by Simon Fraser.

Move algorithm.js and sampler.js to tests/ and benchmark-runner.js to runner/.

Needed by both harnesses.
* Animometer/resources/runner/benchmark-runner.js: Renamed from PerformanceTests/Animometer/resources/debug-runner/benchmark-runner.js.
* Animometer/developer.html:
* Animometer/index.html:

Needed only by the tests. Move to tests/. Statistics, in sampler.js, is used by ResultsDashboard, so move that
into extensions.js.
* Animometer/resources/extensions.js:
* Animometer/tests/resources/algorithm.js: Renamed from PerformanceTests/Animometer/resources/algorithm.js.
* Animometer/tests/resources/sampler.js: Renamed from PerformanceTests/Animometer/resources/sampler.js.
* Animometer/tests/bouncing-particles/bouncing-canvas-images.html:
* Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html:
* Animometer/tests/bouncing-particles/bouncing-css-images.html:
* Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
* Animometer/tests/bouncing-particles/bouncing-svg-images.html:
* Animometer/tests/bouncing-particles/bouncing-svg-shapes.html:
* Animometer/tests/master/canvas-stage.html:
* Animometer/tests/misc/canvas-electrons.html:
* Animometer/tests/misc/canvas-stars.html:
* Animometer/tests/misc/compositing-transforms.html:
* Animometer/tests/simple/simple-canvas-paths.html:
* Animometer/tests/template/template-canvas.html:
* Animometer/tests/template/template-css.html:
* Animometer/tests/template/template-svg.html:
* Animometer/tests/text/layering-text.html:
* Animometer/tests/text/text-boxes.html:

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

23 files changed:
PerformanceTests/Animometer/developer.html
PerformanceTests/Animometer/index.html
PerformanceTests/Animometer/resources/extensions.js
PerformanceTests/Animometer/resources/runner/benchmark-runner.js [moved from PerformanceTests/Animometer/resources/debug-runner/benchmark-runner.js with 100% similarity]
PerformanceTests/Animometer/tests/bouncing-particles/bouncing-canvas-images.html
PerformanceTests/Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html
PerformanceTests/Animometer/tests/bouncing-particles/bouncing-css-images.html
PerformanceTests/Animometer/tests/bouncing-particles/bouncing-css-shapes.html
PerformanceTests/Animometer/tests/bouncing-particles/bouncing-svg-images.html
PerformanceTests/Animometer/tests/bouncing-particles/bouncing-svg-shapes.html
PerformanceTests/Animometer/tests/master/canvas-stage.html
PerformanceTests/Animometer/tests/misc/canvas-electrons.html
PerformanceTests/Animometer/tests/misc/canvas-stars.html
PerformanceTests/Animometer/tests/misc/compositing-transforms.html
PerformanceTests/Animometer/tests/resources/algorithm.js [moved from PerformanceTests/Animometer/resources/algorithm.js with 97% similarity]
PerformanceTests/Animometer/tests/resources/sampler.js [moved from PerformanceTests/Animometer/resources/sampler.js with 74% similarity]
PerformanceTests/Animometer/tests/simple/simple-canvas-paths.html
PerformanceTests/Animometer/tests/template/template-canvas.html
PerformanceTests/Animometer/tests/template/template-css.html
PerformanceTests/Animometer/tests/template/template-svg.html
PerformanceTests/Animometer/tests/text/layering-text.html
PerformanceTests/Animometer/tests/text/text-boxes.html
PerformanceTests/ChangeLog

index 20016fa..d1b4581 100644 (file)
@@ -5,7 +5,6 @@
     <link rel="stylesheet" href="resources/runner/animometer.css">
     <link rel="stylesheet" href="resources/debug-runner/animometer.css">
     <script src="resources/strings.js"></script>
-    <script src="resources/sampler.js"></script>
     <script src="resources/extensions.js" charset="utf-8"></script>
 
     <script src="resources/runner/tests.js" charset="utf-8"></script>
@@ -13,7 +12,7 @@
     <script src="resources/runner/animometer.js"></script>
     <script src="resources/debug-runner/animometer.js"></script>
 
-    <script src="resources/debug-runner/benchmark-runner.js"></script>
+    <script src="resources/runner/benchmark-runner.js"></script>
     <script src="resources/debug-runner/d3.min.js"></script>
     <script src="resources/debug-runner/graph.js"></script>
 </head>
index 0c301e3..e164db5 100644 (file)
@@ -5,13 +5,12 @@
     <meta name="viewport" content="width=device-width, user-scalable=no">
     <link rel="stylesheet" href="resources/runner/animometer.css">
     <script src="resources/strings.js"></script>
-    <script src="resources/sampler.js"></script>
     <script src="resources/extensions.js" charset="utf-8"></script>
 
     <script src="resources/runner/tests.js"></script>
     <script src="resources/runner/animometer.js"></script>
 
-    <script src="resources/debug-runner/benchmark-runner.js"></script>
+    <script src="resources/runner/benchmark-runner.js"></script>
 </head>
 <body>
     <main>
index f31b80e..7082971 100644 (file)
@@ -183,6 +183,33 @@ SimplePromise.prototype.resolve = function (value)
         this._chainedPromise.resolve(result);
 }
 
+var Statistics =
+{
+    sampleMean: function(numberOfSamples, sum)
+    {
+        if (numberOfSamples < 1)
+            return 0;
+        return sum / numberOfSamples;
+    },
+
+    // With sum and sum of squares, we can compute the sample standard deviation in O(1).
+    // See https://rniwa.com/2012-11-10/sample-standard-deviation-in-terms-of-sum-and-square-sum-of-samples/
+    unbiasedSampleStandardDeviation: function(numberOfSamples, sum, squareSum)
+    {
+        if (numberOfSamples < 2)
+            return 0;
+        return Math.sqrt((squareSum - sum * sum / numberOfSamples) / (numberOfSamples - 1));
+    },
+
+    geometricMean: function(values)
+    {
+        if (!values.length)
+            return 0;
+        var roots = values.map(function(value) { return  Math.pow(value, 1 / values.length); })
+        return roots.reduce(function(a, b) { return a * b; });
+    }
+};
+
 window.DocumentExtension =
 {
     createElement: function(name, attrs, parentElement)
index 600485f..84bcf18 100644 (file)
     <img class="hidden" src="../resources/yin-yang.svg">
     <img class="hidden" src="../resources/yin-yang.png">
     <canvas id="stage"></canvas>
-    <script src="../../resources/algorithm.js"></script>
     <script src="../../resources/strings.js"></script>
-    <script src="../../resources/sampler.js"></script>
     <script src="../../resources/extensions.js"></script>
+    <script src="../resources/algorithm.js"></script>
+    <script src="../resources/sampler.js"></script>
     <script src="../resources/math.js"></script>
     <script src="../resources/main.js"></script>
     <script src="resources/bouncing-particles.js"></script>
index 170edf8..ac47fc6 100644 (file)
@@ -5,10 +5,10 @@
 </head>
 <body>
     <canvas id="stage"></canvas>
-    <script src="../../resources/algorithm.js"></script>
     <script src="../../resources/strings.js"></script>
-    <script src="../../resources/sampler.js"></script>
     <script src="../../resources/extensions.js"></script>
+    <script src="../resources/algorithm.js"></script>
+    <script src="../resources/sampler.js"></script>
     <script src="../resources/math.js"></script>
     <script src="../resources/main.js"></script>
     <script src="resources/bouncing-particles.js"></script>
index b3a7bda..bfaca49 100644 (file)
 </head>
 <body>
     <div id="stage"></div>
-    <script src="../../resources/algorithm.js"></script>
     <script src="../../resources/strings.js"></script>
-    <script src="../../resources/sampler.js"></script>
     <script src="../../resources/extensions.js"></script>
+    <script src="../resources/algorithm.js"></script>
+    <script src="../resources/sampler.js"></script>
     <script src="../resources/math.js"></script>
     <script src="../resources/main.js"></script>
     <script src="resources/bouncing-particles.js"></script>
index 39a428c..0f0f579 100644 (file)
 </head>
 <body>
     <div id="stage"></div>
-    <script src="../../resources/algorithm.js"></script>
     <script src="../../resources/strings.js"></script>
-    <script src="../../resources/sampler.js"></script>
     <script src="../../resources/extensions.js"></script>
+    <script src="../resources/algorithm.js"></script>
+    <script src="../resources/sampler.js"></script>
     <script src="../resources/math.js"></script>
     <script src="../resources/main.js"></script>
     <script src="resources/bouncing-particles.js"></script>
index 23da735..bb29050 100644 (file)
@@ -5,10 +5,10 @@
 </head>
 <body>
     <svg id="stage"></svg>
-    <script src="../../resources/algorithm.js"></script>
     <script src="../../resources/strings.js"></script>
-    <script src="../../resources/sampler.js"></script>
     <script src="../../resources/extensions.js"></script>
+    <script src="../resources/algorithm.js"></script>
+    <script src="../resources/sampler.js"></script>
     <script src="../resources/math.js"></script>
     <script src="../resources/main.js"></script>
     <script src="resources/bouncing-particles.js"></script>
index 7d32b4e..ae5193e 100644 (file)
@@ -5,10 +5,10 @@
 </head>
 <body>
     <svg id="stage"></svg>
-    <script src="../../resources/algorithm.js"></script>
     <script src="../../resources/strings.js"></script>
-    <script src="../../resources/sampler.js"></script>
     <script src="../../resources/extensions.js"></script>
+    <script src="../resources/algorithm.js"></script>
+    <script src="../resources/sampler.js"></script>
     <script src="../resources/math.js"></script>
     <script src="../resources/main.js"></script>
     <script src="resources/bouncing-particles.js"></script>
index cd06346..36fc2f7 100644 (file)
@@ -5,10 +5,10 @@
 </head>
 <body>
     <canvas id="stage"></canvas>
-    <script src="../../resources/algorithm.js"></script>
     <script src="../../resources/strings.js"></script>
-    <script src="../../resources/sampler.js"></script>
     <script src="../../resources/extensions.js"></script>
+    <script src="../resources/algorithm.js"></script>
+    <script src="../resources/sampler.js"></script>
     <script src="../resources/math.js"></script>
     <script src="../resources/main.js"></script>
     <script src="resources/canvas-stage.js"></script>
index 34da03a..0d1e9d5 100644 (file)
@@ -5,10 +5,10 @@
 </head>
 <body>
     <canvas id="stage"></canvas>
-    <script src="../../resources/algorithm.js"></script>
     <script src="../../resources/strings.js"></script>
-    <script src="../../resources/sampler.js"></script>
     <script src="../../resources/extensions.js"></script>
+    <script src="../resources/algorithm.js"></script>
+    <script src="../resources/sampler.js"></script>
     <script src="../resources/math.js"></script>
     <script src="../resources/main.js"></script>
     <script src="resources/canvas-electrons.js"></script>
index 1abcb11..ca20c81 100644 (file)
@@ -2,10 +2,10 @@
 <html>
 <head>
     <link rel="stylesheet" type="text/css" href="../resources/stage.css">
-    <script src="../../resources/algorithm.js"></script>
     <script src="../../resources/strings.js"></script>
-    <script src="../../resources/sampler.js"></script>
     <script src="../../resources/extensions.js"></script>
+    <script src="../resources/algorithm.js"></script>
+    <script src="../resources/sampler.js"></script>
     <script src="../resources/math.js"></script>
     <script src="../resources/main.js"></script>
     <script src="resources/canvas-stars.js"></script>
index 6c0778c..9ccb045 100644 (file)
 </head>
 <body>
     <div id="stage"></div>
-    <script src="../../resources/algorithm.js"></script>
     <script src="../../resources/strings.js"></script>
-    <script src="../../resources/sampler.js"></script>
     <script src="../../resources/extensions.js"></script>
+    <script src="../resources/algorithm.js"></script>
+    <script src="../resources/sampler.js"></script>
     <script src="../resources/math.js"></script>
     <script src="../resources/main.js"></script>
     <script src="../bouncing-particles/resources/bouncing-particles.js"></script>
@@ -23,19 +23,19 @@ Heap.prototype =
     {
         return i > 0 ? Math.floor((i - 1) / 2) : -1;
     },
-    
+
     _leftIndex: function(i)
     {
         var leftIndex = i * 2 + 1;
         return leftIndex < this._size ? leftIndex : -1;
     },
-    
+
     _rightIndex: function(i)
     {
         var rightIndex = i * 2 + 2;
         return rightIndex < this._size ? rightIndex : -1;
     },
-    
+
     // Return the child index that may violate the heap property at index i.
     _childIndex: function(i)
     {
@@ -44,20 +44,20 @@ Heap.prototype =
 
         if (left != -1 && right != -1)
             return this._compare(this._values[left], this._values[right]) > 0 ? left : right;
-        
+
         return left != -1 ? left : right;
     },
-    
+
     init: function()
     {
         this._size = 0;
     },
-    
+
     top: function()
     {
         return this._size ? this._values[0] : NaN;
     },
-    
+
     push: function(value)
     {
         if (this._size == this._maxSize) {
@@ -75,11 +75,11 @@ Heap.prototype =
     {
         if (!this._size)
             return NaN;
-        
+
         this._values[0] = this._values[--this._size];
         this._sink(0);
     },
-    
+
     _bubble: function(i)
     {
         // Fix the heap property at index i given that parent is the only node that
@@ -87,11 +87,11 @@ Heap.prototype =
         for (var pi = this._parentIndex(i); pi != -1; i = pi, pi = this._parentIndex(pi)) {
             if (this._compare(this._values[pi], this._values[i]) > 0)
                 break;
-                
+
             this._values.swap(pi, i);
         }
     },
-    
+
     _sink: function(i)
     {
         // Fix the heap property at index i given that each of the left and the right
@@ -99,11 +99,11 @@ Heap.prototype =
         for (var ci = this._childIndex(i); ci != -1; i = ci, ci = this._childIndex(ci)) {
             if (this._compare(this._values[i], this._values[ci]) > 0)
                 break;
-            
+
             this._values.swap(ci, i);
         }
     },
-    
+
     str: function()
     {
         var out = "Heap[" + this._size + "] = [";
@@ -114,7 +114,7 @@ Heap.prototype =
         }
         return out + "]";
     },
-    
+
     values: function(size) {
         // Return the last "size" heap elements values.
         var values = this._values.slice(0, this._size);
@@ -127,7 +127,7 @@ var Algorithm = {
     {
         return new Heap(maxSize, function(a, b) { return b - a; });
     },
-    
+
     createMaxHeap: function(maxSize) {
         return new Heap(maxSize, function(a, b) { return a - b; });
     }
@@ -1,30 +1,3 @@
-var Statistics =
-{
-    sampleMean: function(numberOfSamples, sum)
-    {
-        if (numberOfSamples < 1)
-            return 0;
-        return sum / numberOfSamples;
-    },
-
-    // With sum and sum of squares, we can compute the sample standard deviation in O(1).
-    // See https://rniwa.com/2012-11-10/sample-standard-deviation-in-terms-of-sum-and-square-sum-of-samples/
-    unbiasedSampleStandardDeviation: function(numberOfSamples, sum, squareSum)
-    {
-        if (numberOfSamples < 2)
-            return 0;
-        return Math.sqrt((squareSum - sum * sum / numberOfSamples) / (numberOfSamples - 1));
-    },
-
-    geometricMean: function(values)
-    {
-        if (!values.length)
-            return 0;
-        var roots = values.map(function(value) { return  Math.pow(value, 1 / values.length); })
-        return roots.reduce(function(a, b) { return a * b; });
-    }
-}
-
 function Experiment()
 {
     this._sum = 0;
index 4a2da8f..f267820 100644 (file)
@@ -5,10 +5,10 @@
 </head>
 <body>
     <canvas id="stage"></canvas>
-    <script src="../../resources/algorithm.js"></script>
     <script src="../../resources/strings.js"></script>
-    <script src="../../resources/sampler.js"></script>
     <script src="../../resources/extensions.js"></script>
+    <script src="../resources/algorithm.js"></script>
+    <script src="../resources/sampler.js"></script>
     <script src="../resources/math.js"></script>
     <script src="../resources/main.js"></script>
     <script src="../master/resources/canvas-stage.js"></script>
index b87ba79..11ddfaa 100644 (file)
@@ -5,10 +5,10 @@
 </head>
 <body>
     <canvas id="stage"></canvas>
-    <script src="../../resources/algorithm.js"></script>
     <script src="../../resources/strings.js"></script>
-    <script src="../../resources/sampler.js"></script>
     <script src="../../resources/extensions.js"></script>
+    <script src="../resources/algorithm.js"></script>
+    <script src="../resources/sampler.js"></script>
     <script src="../resources/math.js"></script>
     <script src="../resources/main.js"></script>
     <script src="resources/template-canvas.js"></script>
index 90bf2e9..b2ba479 100644 (file)
@@ -5,10 +5,10 @@
 </head>
 <body>
     <div id="stage"></div>
-    <script src="../../resources/algorithm.js"></script>
     <script src="../../resources/strings.js"></script>
-    <script src="../../resources/sampler.js"></script>
     <script src="../../resources/extensions.js"></script>
+    <script src="../resources/algorithm.js"></script>
+    <script src="../resources/sampler.js"></script>
     <script src="../resources/math.js"></script>
     <script src="../resources/main.js"></script>
     <script src="resources/template-css.js"></script>
index 2e0df9a..425ec36 100644 (file)
@@ -5,10 +5,10 @@
 </head>
 <body>
     <svg id="stage"></svg>
-    <script src="../../resources/algorithm.js"></script>
     <script src="../../resources/strings.js"></script>
-    <script src="../../resources/sampler.js"></script>
     <script src="../../resources/extensions.js"></script>
+    <script src="../resources/algorithm.js"></script>
+    <script src="../resources/sampler.js"></script>
     <script src="../resources/math.js"></script>
     <script src="../resources/main.js"></script>
     <script src="resources/template-svg.js"></script>
index fbff373..4180bba 100644 (file)
 </head>
 <body>
     <div id="stage"></div>
-    <script src="../../resources/algorithm.js"></script>
     <script src="../../resources/strings.js"></script>
-    <script src="../../resources/sampler.js"></script>
     <script src="../../resources/extensions.js"></script>
+    <script src="../resources/algorithm.js"></script>
+    <script src="../resources/sampler.js"></script>
     <script src="../resources/math.js"></script>
     <script src="../resources/main.js"></script>
     <script src="resources/layering-text.js"></script>
index 6c106f8..828ca71 100644 (file)
         ನನಗೆ ಹಾನಿ ಆಗದೆ, ನಾನು ಗಜನ್ನು ತಿನಬಹುದು
     </div>
     <div id="stage"></div>
-    <script src="../../resources/algorithm.js"></script>
     <script src="../../resources/strings.js"></script>
-    <script src="../../resources/sampler.js"></script>
     <script src="../../resources/extensions.js"></script>
+    <script src="../resources/algorithm.js"></script>
+    <script src="../resources/sampler.js"></script>
     <script src="../resources/math.js"></script>
     <script src="../resources/main.js"></script>
     <script src="../bouncing-particles/resources/bouncing-particles.js"></script>
index 512ca1f..caf019c 100644 (file)
@@ -1,3 +1,39 @@
+2016-01-03  Jon Lee  <jonlee@apple.com>
+
+        Update benchmark test suite
+        https://bugs.webkit.org/show_bug.cgi?id=152679
+
+        Reviewed by Simon Fraser.
+
+        Move algorithm.js and sampler.js to tests/ and benchmark-runner.js to runner/.
+
+        Needed by both harnesses.
+        * Animometer/resources/runner/benchmark-runner.js: Renamed from PerformanceTests/Animometer/resources/debug-runner/benchmark-runner.js.
+        * Animometer/developer.html:
+        * Animometer/index.html:
+
+        Needed only by the tests. Move to tests/. Statistics, in sampler.js, is used by ResultsDashboard, so move that
+        into extensions.js.
+        * Animometer/resources/extensions.js:
+        * Animometer/tests/resources/algorithm.js: Renamed from PerformanceTests/Animometer/resources/algorithm.js.
+        * Animometer/tests/resources/sampler.js: Renamed from PerformanceTests/Animometer/resources/sampler.js.
+        * Animometer/tests/bouncing-particles/bouncing-canvas-images.html:
+        * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html:
+        * Animometer/tests/bouncing-particles/bouncing-css-images.html:
+        * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
+        * Animometer/tests/bouncing-particles/bouncing-svg-images.html:
+        * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html:
+        * Animometer/tests/master/canvas-stage.html:
+        * Animometer/tests/misc/canvas-electrons.html:
+        * Animometer/tests/misc/canvas-stars.html:
+        * Animometer/tests/misc/compositing-transforms.html:
+        * Animometer/tests/simple/simple-canvas-paths.html:
+        * Animometer/tests/template/template-canvas.html:
+        * Animometer/tests/template/template-css.html:
+        * Animometer/tests/template/template-svg.html:
+        * Animometer/tests/text/layering-text.html:
+        * Animometer/tests/text/text-boxes.html:
+
 2016-01-07  Jon Lee  <jonlee@apple.com>
 
         Update benchmark test suite