Merge r219640 into Speedometer 1.0.
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Jul 2017 00:33:07 +0000 (00:33 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Jul 2017 00:33:07 +0000 (00:33 +0000)
* Speedometer/resources/benchmark-runner.js:
(BenchmarkRunner.prototype._writeMark):
(BenchmarkRunner.prototype._runTest):
(BenchmarkRunner.prototype._runTestAndRecordResults):

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

Websites/browserbench.org/ChangeLog
Websites/browserbench.org/Speedometer/resources/benchmark-runner.js

index cf8a05a..59e2d62 100644 (file)
@@ -1,3 +1,12 @@
+2017-07-18  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Merge r219640 into Speedometer 1.0.
+
+        * Speedometer/resources/benchmark-runner.js:
+        (BenchmarkRunner.prototype._writeMark):
+        (BenchmarkRunner.prototype._runTest):
+        (BenchmarkRunner.prototype._runTestAndRecordResults):
+
 2017-07-14  Saam Barati  <sbarati@apple.com>
 
         Fix ambiguous description text in ARES-6 about the data the benchmark measures
index 36c03c4..aaaf6b4 100644 (file)
@@ -112,22 +112,32 @@ BenchmarkRunner.prototype._waitAndWarmUp = function () {
     return promise;
 }
 
+BenchmarkRunner.prototype._writeMark = function(name) {
+    if (window.performance && window.performance.mark)
+        window.performance.mark(name);
+}
+
 // This function ought be as simple as possible. Don't even use SimplePromise.
-BenchmarkRunner.prototype._runTest = function(suite, testFunction, prepareReturnValue, callback)
+BenchmarkRunner.prototype._runTest = function(suite, test, prepareReturnValue, callback)
 {
+    var self = this;
     var now = window.performance && window.performance.now ? function () { return window.performance.now(); } : Date.now;
 
-    var contentWindow = this._frame.contentWindow;
-    var contentDocument = this._frame.contentDocument;
+    var contentWindow = self._frame.contentWindow;
+    var contentDocument = self._frame.contentDocument;
 
+    self._writeMark(`${suite.name}.${test.name}-start`);
     var startTime = now();
-    testFunction(prepareReturnValue, contentWindow, contentDocument);
+    test.run(prepareReturnValue, contentWindow, contentDocument);
     var endTime = now();
+    self._writeMark(`${suite.name}.${test.name}-sync-end`);
+
     var syncTime = endTime - startTime;
 
     var startTime = now();
     setTimeout(function () {
         var endTime = now();
+        self._writeMark(`${suite.name}.${test.name}-async-end`);
         callback(syncTime, endTime - startTime);
     }, 0);
 }
@@ -239,7 +249,7 @@ BenchmarkRunner.prototype._runTestAndRecordResults = function (state) {
 
     var self = this;
     setTimeout(function () {
-        self._runTest(suite, test.run, self._prepareReturnValue, function (syncTime, asyncTime) {
+        self._runTest(suite, test, self._prepareReturnValue, function (syncTime, asyncTime) {
             var suiteResults = self._measuredValues.tests[suite.name] || {tests:{}, total: 0};
             var total = syncTime + asyncTime;
             self._measuredValues.tests[suite.name] = suiteResults;