Skip to content
Permalink
Browse files
Make run-perf-tests work with StyleBench and re-enable it
https://bugs.webkit.org/show_bug.cgi?id=182322

Reviewed by Antti Koivisto.

This patch updates the test harness to report new metrics of StyleBench.

Replaced the total time by the geometric mean of the time spent in each suite, and added scores
as a metric in addition to time. Also, updated the PerfTestRunner harness and the results template
to support "Score" metric with "pt" as its unit.

* Skipped: Unskipped the test.
* StyleBench/resources/benchmark-report.js:
(window.benchmarkClient.willStartFirstIteration..createTest): Added the unit as an optional argument
to report the score in addition to time. Also report the geomean of time instead of the total time.
(window.benchmarkClient.willStartFirstIteration): Report the geomean of time.
(window.benchmarkClient.didRunSuites): Record the entire measuredValues instead of just tests.
(window.benchmarkClient.didFinishLastIteration): Report the scores.
* resources/results-template.html: Added "Score" as a metric and "pt" as its unit.
* resources/runner.js:
(PerfTestRunner..finish): Ditto.


Canonical link: https://commits.webkit.org/198168@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227946 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
rniwa committed Feb 1, 2018
1 parent 7ee6044 commit 3a5033dd54f85ddf3ff16fb06e344eb345eab734
Showing 5 changed files with 37 additions and 10 deletions.
@@ -1,3 +1,27 @@
2018-01-31 Ryosuke Niwa <rniwa@webkit.org>

Make run-perf-tests work with StyleBench and re-enable it
https://bugs.webkit.org/show_bug.cgi?id=182322

Reviewed by Antti Koivisto.

This patch updates the test harness to report new metrics of StyleBench.

Replaced the total time by the geometric mean of the time spent in each suite, and added scores
as a metric in addition to time. Also, updated the PerfTestRunner harness and the results template
to support "Score" metric with "pt" as its unit.

* Skipped: Unskipped the test.
* StyleBench/resources/benchmark-report.js:
(window.benchmarkClient.willStartFirstIteration..createTest): Added the unit as an optional argument
to report the score in addition to time. Also report the geomean of time instead of the total time.
(window.benchmarkClient.willStartFirstIteration): Report the geomean of time.
(window.benchmarkClient.didRunSuites): Record the entire measuredValues instead of just tests.
(window.benchmarkClient.didFinishLastIteration): Report the scores.
* resources/results-template.html: Added "Score" as a metric and "pt" as its unit.
* resources/runner.js:
(PerfTestRunner..finish): Ditto.

2018-01-30 Ryosuke Niwa <rniwa@webkit.org>

StyleBench: Generate more mutation steps
@@ -84,7 +84,6 @@ Layout/LineLayoutJapanese.html
# Don't run the interactive runner. We run index.html
Speedometer/index.html
Speedometer/InteractiveRunner.html
StyleBench/index.html
StyleBench/InteractiveRunner.html

# We skip Shapes tests for now: https://bugs.webkit.org/show_bug.cgi?id=128188
@@ -26,21 +26,21 @@
window.benchmarkClient = {
iterationCount: 5, // Use 4 different instances of DRT/WTR to run 5 iterations.
willStartFirstIteration: function (iterationCount) {
createTest = function (name, aggregator, isLastTest) {
createTest = function (name, aggregator, isLastTest, unit = 'ms') {
return {
customIterationCount: iterationCount,
doNotIgnoreInitialRun: true,
doNotMeasureMemoryUsage: true,
continueTesting: !isLastTest,
unit: 'ms',
unit: unit,
name: name,
aggregator: aggregator};
}
PerfTestRunner.prepareToMeasureValuesAsync(createTest(null, 'Total'));
PerfTestRunner.prepareToMeasureValuesAsync(createTest(null, 'Geometric'));
},
didRunSuites: function (measuredValues) {
PerfTestRunner.measureValueAsync(measuredValues.total);
valuesByIteration.push(measuredValues.tests);
PerfTestRunner.measureValueAsync(measuredValues.geomean);
valuesByIteration.push(measuredValues);
},
didFinishLastIteration: function () {
document.head.removeChild(document.querySelector('style'));
@@ -53,9 +53,11 @@
values.aggregator = aggregator;
}

var scores = [];
valuesByIteration.forEach(function (measuredValues) {
for (var suiteName in measuredValues) {
var suite = measuredValues[suiteName];
scores.push(measuredValues.score);
for (var suiteName in measuredValues.tests) {
var suite = measuredValues.tests[suiteName];
for (var testName in suite.tests) {
var test = suite.tests[testName];
for (var subtestName in test.tests)
@@ -66,6 +68,8 @@
}
});

PerfTestRunner.reportValues(createTest(null, null, false, 'pt'), scores);

var fullNames = new Array;
for (var fullName in measuredValuesByFullName)
fullNames.push(fullName);
@@ -227,7 +227,7 @@
var testResults = [];
var cachedUnit = null;
var cachedScalingFactor = null;
var unit = {'FrameRate': 'fps', 'Runs': 'runs/s', 'Time': 'ms', 'Malloc': 'bytes', 'JSHeap': 'bytes'}[metric];
var unit = {'FrameRate': 'fps', 'Runs': 'runs/s', 'Score': 'pt', 'Time': 'ms', 'Malloc': 'bytes', 'JSHeap': 'bytes'}[metric];

// We can't do this in TestResult because all results for each test need to share the same unit and the same scaling factor.
function computeScalingFactorIfNeeded() {
@@ -223,7 +223,7 @@ if (window.testRunner) {
var prefix = currentTest.name || '';
if (currentTest.description)
PerfTestRunner.log("Description: " + currentTest.description);
metric = {'fps': 'FrameRate', 'runs/s': 'Runs', 'ms': 'Time'}[PerfTestRunner.unit];
metric = {'fps': 'FrameRate', 'runs/s': 'Runs', 'pt': 'Score', 'ms': 'Time'}[PerfTestRunner.unit];
var suffix = currentTest.aggregator ? ':' + currentTest.aggregator : '';
PerfTestRunner.logStatistics(results, PerfTestRunner.unit, prefix + ":" + metric + suffix);
if (jsHeapResults.length) {

0 comments on commit 3a5033d

Please sign in to comment.