Host DoYouEvenBench on webkit.org
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Jan 2014 21:10:37 +0000 (21:10 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Jan 2014 21:10:37 +0000 (21:10 +0000)
https://bugs.webkit.org/show_bug.cgi?id=127185

Reviewed by Benjamin Poulain.

PerformanceTests:

Compute the resources directory relative to the benchmark-runner's location
so that we can load tests even if the runner HTML was located elsewhere.

* DoYouEvenBench/Full.html:
* DoYouEvenBench/resources/benchmark-runner.js:
(BenchmarkState._containingDirectory):

Websites/webkit.org:

Added webkit.org/perf/DoYouEvenBench.

* perf/DoYouEvenBench: Added.
* perf/DoYouEvenBench/index.html: Copied from PerformanceTests/DoYouEvenBench/Full.html.

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

PerformanceTests/ChangeLog
PerformanceTests/DoYouEvenBench/resources/benchmark-runner.js
Websites/webkit.org/ChangeLog
Websites/webkit.org/perf/DoYouEvenBench/index.html [new file with mode: 0644]

index 1c01ff9..7695ef5 100644 (file)
@@ -1,5 +1,19 @@
 2014-01-17  Ryosuke Niwa  <rniwa@webkit.org>
 
+        Host DoYouEvenBench on webkit.org
+        https://bugs.webkit.org/show_bug.cgi?id=127185
+
+        Reviewed by Benjamin Poulain.
+
+        Compute the resources directory relative to the benchmark-runner's location
+        so that we can load tests even if the runner HTML was located elsewhere.
+
+        * DoYouEvenBench/Full.html:
+        * DoYouEvenBench/resources/benchmark-runner.js:
+        (BenchmarkState._containingDirectory):
+
+2014-01-17  Ryosuke Niwa  <rniwa@webkit.org>
+
         DoYouEvenBench: Move flightjs-example-app and todomvc into resources
         https://bugs.webkit.org/show_bug.cgi?id=127183
 
index 6c1148b..131bf9a 100644 (file)
@@ -163,13 +163,18 @@ BenchmarkState.prototype.isFirstTest = function () {
     return !this._testIndex;
 }
 
+BenchmarkState._containingDirectory = (function () {
+    var src = document.currentScript.src;
+    return src.substring(0, src.lastIndexOf('/')) + '/';
+})();
+
 BenchmarkState.prototype.prepareCurrentSuite = function (runner, frame) {
     var suite = this.currentSuite();
     var promise = new SimplePromise;
     frame.onload = function () {
         suite.prepare(runner, frame.contentWindow, frame.contentDocument).then(function (result) { promise.resolve(result); });
     }
-    frame.src = 'resources/' + suite.url;
+    frame.src = BenchmarkState._containingDirectory + suite.url;
     return promise;
 }
 
index be8ede6..e847236 100644 (file)
@@ -1,3 +1,15 @@
+2014-01-17  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Host DoYouEvenBench on webkit.org
+        https://bugs.webkit.org/show_bug.cgi?id=127185
+
+        Reviewed by Benjamin Poulain.
+
+        Added webkit.org/perf/DoYouEvenBench.
+
+        * perf/DoYouEvenBench: Added.
+        * perf/DoYouEvenBench/index.html: Copied from PerformanceTests/DoYouEvenBench/Full.html.
+
 2014-01-03  Alex Christensen  <achristensen@webkit.org>
 
         Added GStreamer to list of required tools for compiling webkit.
diff --git a/Websites/webkit.org/perf/DoYouEvenBench/index.html b/Websites/webkit.org/perf/DoYouEvenBench/index.html
new file mode 100644 (file)
index 0000000..33eafac
--- /dev/null
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>DoYouEvenBench</title>
+<script>
+
+(function () {
+    var values = [];
+    var pre = null;
+    var iterationNumber = 0;
+    window.benchmarkClient = {
+        didRunSuites: function (measuredValues) {
+            if (!pre) {
+                pre = document.createElement('pre');
+                pre.style.paddingTop = '600px';
+                document.body.appendChild(pre);
+            }
+            values.push(measuredValues.total);
+            iterationNumber++;
+            pre.appendChild(document.createTextNode('Iteration ' + iterationNumber + ': ' + measuredValues.total + ' ms\n'));
+        },
+        didFinishLastIteration: function () {
+            var sum = 0;
+            for (var i = 0; i < values.length; i++)
+                sum += values[i];
+            pre.appendChild(document.createTextNode('Average: ' + (sum / iterationNumber)  + ' ms\n'));
+            pre.style.paddingTop = 0;
+        }
+    }
+})();
+
+function startTest() {
+    var iterationCount = 5;
+    var runner = new BenchmarkRunner(Suites, benchmarkClient);
+    runner.runMultipleIterations(iterationCount);
+}
+
+</script>
+<script src="https://svn.webkit.org/repository/webkit/trunk/PerformanceTests/DoYouEvenBench/resources/benchmark-runner.js"></script>
+<script src="https://svn.webkit.org/repository/webkit/trunk/PerformanceTests/DoYouEvenBench/resources/benchmark-report.js"></script>
+<script src="https://svn.webkit.org/repository/webkit/trunk/PerformanceTests/DoYouEvenBench/resources/tests.js"></script>
+</head>
+<body onload="startTest()">
+</body>
+</html>