Changeset 219640 in webkit


Ignore:
Timestamp:
Jul 18, 2017 4:22:46 PM (7 years ago)
Author:
commit-queue@webkit.org
Message:

Add performance.mark()s around each test step
https://bugs.webkit.org/show_bug.cgi?id=174530

Patch by Matt Kotsenas <mattkot@microsoft.com> on 2017-07-18
Reviewed by Ryosuke Niwa.

Add performance.mark() around each test step to make analysis
simpler. Now each test step can be investigated via dev tools, ETW, etc.

  • Speedometer/resources/benchmark-runner.js:

(BenchmarkRunner.prototype._writeMark):
(BenchmarkRunner.prototype._runTest):
(BenchmarkRunner.prototype._runTestAndRecordResults):

Location:
trunk/PerformanceTests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/PerformanceTests/ChangeLog

    r219512 r219640  
     12017-07-18  Matt Kotsenas  <mattkot@microsoft.com>
     2
     3        Add performance.mark()s around each test step
     4        https://bugs.webkit.org/show_bug.cgi?id=174530
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Add `performance.mark()` around each test step to make analysis
     9        simpler. Now each test step can be investigated via dev tools, ETW, etc.
     10
     11        * Speedometer/resources/benchmark-runner.js:
     12        (BenchmarkRunner.prototype._writeMark):
     13        (BenchmarkRunner.prototype._runTest):
     14        (BenchmarkRunner.prototype._runTestAndRecordResults):
     15
    1162017-07-14  Saam Barati  <sbarati@apple.com>
    217
  • trunk/PerformanceTests/Speedometer/resources/benchmark-runner.js

    r217112 r219640  
    113113}
    114114
     115BenchmarkRunner.prototype._writeMark = function(name) {
     116    if (window.performance && window.performance.mark)
     117        window.performance.mark(name);
     118}
     119
    115120// This function ought be as simple as possible. Don't even use SimplePromise.
    116 BenchmarkRunner.prototype._runTest = function(suite, testFunction, prepareReturnValue, callback)
     121BenchmarkRunner.prototype._runTest = function(suite, test, prepareReturnValue, callback)
    117122{
     123    var self = this;
    118124    var now = window.performance && window.performance.now ? function () { return window.performance.now(); } : Date.now;
    119125
    120     var contentWindow = this._frame.contentWindow;
    121     var contentDocument = this._frame.contentDocument;
    122 
     126    var contentWindow = self._frame.contentWindow;
     127    var contentDocument = self._frame.contentDocument;
     128
     129    self._writeMark(`${suite.name}.${test.name}-start`);
    123130    var startTime = now();
    124     testFunction(prepareReturnValue, contentWindow, contentDocument);
     131    test.run(prepareReturnValue, contentWindow, contentDocument);
    125132    var endTime = now();
     133    self._writeMark(`${suite.name}.${test.name}-sync-end`);
     134
    126135    var syncTime = endTime - startTime;
    127136
     
    129138    setTimeout(function () {
    130139        var endTime = now();
     140        self._writeMark(`${suite.name}.${test.name}-async-end`);
    131141        callback(syncTime, endTime - startTime);
    132142    }, 0);
     
    241251    var self = this;
    242252    setTimeout(function () {
    243         self._runTest(suite, test.run, self._prepareReturnValue, function (syncTime, asyncTime) {
     253        self._runTest(suite, test, self._prepareReturnValue, function (syncTime, asyncTime) {
    244254            var suiteResults = self._measuredValues.tests[suite.name] || {tests:{}, total: 0};
    245255            var total = syncTime + asyncTime;
Note: See TracChangeset for help on using the changeset viewer.