Skip to content

Commit

Permalink
Add signposts to Speedometer
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=247591
rdar://102061752

Reviewed by Dewei Zhu.

This patch adds signpost patches to Speedometer plans, which will allow us to annotate generated profiles (--profile).

* Tools/Scripts/webkitpy/benchmark_runner/data/patches/signposts/Speedometer2.patch: Added.
* Tools/Scripts/webkitpy/benchmark_runner/data/plans/speedometer2.0.plan:
* Tools/Scripts/webkitpy/benchmark_runner/data/plans/speedometer2.1.plan:

Canonical link: https://commits.webkit.org/257454@main
  • Loading branch information
xw committed Dec 7, 2022
1 parent 82f024a commit ce23b74
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
@@ -0,0 +1,33 @@

diff --git a/PerformanceTests/Speedometer/resources/benchmark-runner.js b/PerformanceTests/Speedometer/resources/benchmark-runner.js
index 47cedfc09a4c..82a34562bfc2 100644
--- a/resources/benchmark-runner.js
+++ b/resources/benchmark-runner.js
@@ -125,21 +125,27 @@ BenchmarkRunner.prototype._runTest = function(suite, test, prepareReturnValue, c

var contentWindow = self._frame.contentWindow;
var contentDocument = self._frame.contentDocument;
+ let syncName = suite.name + '.' + test.name + '-sync';
+ let asyncName = suite.name + '.' + test.name + '-async';

self._writeMark(suite.name + '.' + test.name + '-start');
+ __signpostStart(syncName);
var startTime = now();
test.run(prepareReturnValue, contentWindow, contentDocument);
var endTime = now();
+ __signpostStop(syncName);
self._writeMark(suite.name + '.' + test.name + '-sync-end');

var syncTime = endTime - startTime;

+ __signpostStart(asyncName);
var startTime = now();
setTimeout(function () {
// Some browsers don't immediately update the layout for paint.
// Force the layout here to ensure we're measuring the layout time.
var height = self._frame.contentDocument.body.getBoundingClientRect().height;
var endTime = now();
+ __signpostStop(asyncName);
self._frame.contentWindow._unusedHeightValue = height; // Prevent dead code elimination.
self._writeMark(suite.name + '.' + test.name + '-async-end');
callback(syncTime, endTime - startTime, height);
Expand Up @@ -3,6 +3,7 @@
"count": 4,
"svn_source": "https://svn.webkit.org/repository/webkit/trunk/PerformanceTests/Speedometer/@r226694",
"webserver_benchmark_patch": "data/patches/webserver/Speedometer2.patch",
"signpost_patch": "data/patches/signposts/Speedometer2.patch",
"entry_point": "index.html",
"output_file": "speedometer2.result"
}
Expand Up @@ -3,6 +3,7 @@
"count": 4,
"svn_source": "https://svn.webkit.org/repository/webkit/trunk/PerformanceTests/Speedometer/@r290664",
"webserver_benchmark_patch": "data/patches/webserver/Speedometer2.patch",
"signpost_patch": "data/patches/signposts/Speedometer2.patch",
"entry_point": "index.html",
"output_file": "speedometer2.result"
}

0 comments on commit ce23b74

Please sign in to comment.