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 20016fa2768a562aeb2d7039e8f241f2fbba921a..d1b4581177daec7b4fc66eac5223674fea9a573c 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 0c301e32ada595d73a4c5664bf69fec1ca4a86d3..e164db5381938f49585ddb94439543b9e8b31390 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 f31b80e50857b88cad9dc87fafa400615cf7fecb..7082971a8680be07dbf9cc8e766619b7d2efd60d 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 600485faadc656917f7c81843c548e28e078ebd7..84bcf18ef100b4f44e89b3acee7d5e30fad17b19 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 170edf876e94e94894048c61d56ce285f04b7dc0..ac47fc6ab3542a7ecda049ebb90c2eca2dc91f6e 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 b3a7bdab35af5c46510558b0f4bf26e71d90ccb3..bfaca496e85f2313b357bcfa557bae2053a94afb 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 39a428c1f0d1a36ffbe02037403d2052ae333c08..0f0f579a30da149c4b1749ac53bd5ea443221319 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 23da735dc3fc3b158f44be9c57ae4a8dc17daa8f..bb2905056f60961b877aa065e2e1d98b8b1770e7 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 7d32b4e016ce43705e848bd1d7723b5ca77ac410..ae5193ef5c9371bb64c9ce30f087775c4764d665 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 cd063465287c6dc63e7fd887678e36970d086e3d..36fc2f7182a14626cd7224bdd7f57983c6ed1748 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 34da03a7f9e66b06994d91549d310cdc01f40c33..0d1e9d5a003ee4aef27d4b1ee16f7f3bd1fe2fe2 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 1abcb114e565d34c7f882f0852d7e93191bbc487..ca20c819b7ee54f4d9da637d8d4d4dd6ea241828 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 6c0778c7ff6886925246046ea4a1c86743bb539e..9ccb0450572b23aff4dd029f11f70874660441b5 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>
similarity index 97%
rename from PerformanceTests/Animometer/resources/algorithm.js
rename to PerformanceTests/Animometer/tests/resources/algorithm.js
index 0ef21a9cd0752a741ea458afa311925dfd6f1d62..41188b152da58394f4bdf4bf5c5edb89c1d5a6aa 100644 (file)
@@ -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; });
     }
similarity index 74%
rename from PerformanceTests/Animometer/resources/sampler.js
rename to PerformanceTests/Animometer/tests/resources/sampler.js
index cd1efffccea01db8dc728894ce1b3013d72abb33..e9c62ee2cb5b3fb9ae74fb89c5e120c16e2bc5dd 100644 (file)
@@ -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 4a2da8f6e7609f762ecc29b6a1d9dc150582f4b1..f267820bbf4b0874721b91690a70b3366d8b6e7b 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 b87ba7954503e38078b9dc66ab129983154423dd..11ddfaaea3dafffb92030ac785e94a08f43e8827 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 90bf2e9bff767216739076290d0e5a20c096ecc3..b2ba479e02d5cdb6dc911e7854d898712a94c8b2 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 2e0df9a51465c2a90ee0e23a26540acc1ca53256..425ec369d7ff9267139041603be96800f01b3c7e 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 fbff373e51f3475be9edd1d7b9a8d6195dbd3db8..4180bbaa5e896e63d0f45b3f50007c85abec7696 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 6c106f88edd58d321dfbd47144bad1e406e43835..828ca71ddaf1b2556271a45ada8687ee8388016e 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 512ca1fdcecf21f80232d29791eb229d302788b2..caf019c8a6446e1e0f034bfc9486b406a89b1e30 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