Bug 1692854 - Migrate sunspider to browsertime desktop r=perftest-reviewers,Bebe

Latest build: https://treeherder.mozilla.org/#/jobs?repo=try&revision=bbc8933ad3a50c0acbe020cf1f7074122263077b
Please leave the landing to the author of the patch!

Differential Revision: https://phabricator.services.mozilla.com/D106935
This commit is contained in:
Alex Ionescu 2021-03-25 12:29:07 +00:00
Родитель 06a35153dd
Коммит ea243fc1ab
6 изменённых файлов: 59 добавлений и 33 удалений

Просмотреть файл

@ -146,6 +146,7 @@ browsertime-benchmark:
- [wasm-godot, godot]
- [wasm-godot-baseline, godot-b]
- [wasm-godot-optimizing, godot-i]
- [sunspider, ss]
variants: ["fission"]
apps: ["firefox"]
treeherder-symbol: Btime()

Просмотреть файл

@ -255,6 +255,7 @@ raptor-sunspider-firefox:
variants: ["fission"]
try-name: raptor-sunspider-firefox
treeherder-symbol: Rap(ss)
run-on-projects: []
mozharness:
extra-options:
- --test=raptor-sunspider
@ -263,6 +264,7 @@ raptor-sunspider-firefox-profiling:
description: "Raptor SunSpider on Firefox with Gecko Profiling"
try-name: raptor-sunspider-firefox-profiling
treeherder-symbol: Rap-Prof(ss)
run-on-projects: []
max-run-time: 900
mozharness:
extra-options:

Просмотреть файл

@ -900,6 +900,39 @@ class PerftestOutput(object):
return subtests, vals
def parseSunspiderOutput(self, test):
_subtests = {}
data = test["measurements"]["sunspider"]
for page_cycle in data:
for sub, replicates in page_cycle[0].items():
# for each pagecycle, build a list of subtests and append all related replicates
if sub not in _subtests:
# subtest not added yet, first pagecycle, so add new one
_subtests[sub] = {
"unit": test["subtest_unit"],
"alertThreshold": float(test["alert_threshold"]),
"lowerIsBetter": test["subtest_lower_is_better"],
"name": sub,
"replicates": [],
}
# pylint: disable=W1633
_subtests[sub]["replicates"].extend(
[float(round(x, 3)) for x in replicates]
)
subtests = []
vals = []
names = list(_subtests)
names.sort(reverse=True)
for name in names:
_subtests[name]["value"] = filters.mean(_subtests[name]["replicates"])
subtests.append(_subtests[name])
vals.append([_subtests[name]["value"], name])
return subtests, vals
class RaptorOutput(PerftestOutput):
"""class for raptor output"""
@ -1265,39 +1298,6 @@ class RaptorOutput(PerftestOutput):
return subtests, vals
def parseSunspiderOutput(self, test):
_subtests = {}
data = test["measurements"]["sunspider"]
for page_cycle in data:
for sub, replicates in page_cycle[0].items():
# for each pagecycle, build a list of subtests and append all related replicates
if sub not in _subtests:
# subtest not added yet, first pagecycle, so add new one
_subtests[sub] = {
"unit": test["subtest_unit"],
"alertThreshold": float(test["alert_threshold"]),
"lowerIsBetter": test["subtest_lower_is_better"],
"name": sub,
"replicates": [],
}
# pylint: disable=W1633
_subtests[sub]["replicates"].extend(
[float(round(x, 3)) for x in replicates]
)
subtests = []
vals = []
names = list(_subtests)
names.sort(reverse=True)
for name in names:
_subtests[name]["value"] = filters.mean(_subtests[name]["replicates"])
subtests.append(_subtests[name])
vals.append([_subtests[name]["value"], name])
return subtests, vals
def parseAssortedDomOutput(self, test):
# each benchmark 'index' becomes a subtest; each pagecycle / iteration
# of the test has multiple values
@ -1564,6 +1564,8 @@ class BrowsertimeOutput(PerftestOutput):
subtests, vals = self.parseWebaudioOutput(test)
if "wasm-godot" in test["measurements"]:
subtests, vals = self.parseWASMGodotOutput(test)
if "sunspider" in test["measurements"]:
subtests, vals = self.parseSunspiderOutput(test)
if subtests is None:
raise Exception("No benchmark metrics found in browsertime results")

Просмотреть файл

@ -56,3 +56,4 @@
[include:tests/benchmarks/wasm-godot.ini]
[include:tests/benchmarks/wasm-godot-baseline.ini]
[include:tests/benchmarks/wasm-godot-optimizing.ini]
[include:tests/benchmarks/sunspider.ini]

Просмотреть файл

@ -0,0 +1,19 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# sunspider benchmark for firefox and chromium distributions
[DEFAULT]
type = benchmark
apps = firefox, chrome, chromium
test_url = http://<host>:<port>/SunSpider/sunspider-1.0.1/sunspider-1.0.1/driver.html?raptor
page_cycles = 5
page_timeout = 55000
unit = ms
lower_is_better = true
alert_threshold = 2.0
gecko_profile_interval = 1
gecko_profile_entries = 8000000
[sunspider]

Просмотреть файл

@ -113,6 +113,7 @@ function finish()
const _data = ['raptor-benchmark', 'sunspider', benchmarkResults];
window.postMessage(_data, '*');
window.sessionStorage.setItem('benchmark_results', JSON.stringify(_data));
}
location = "results.html?" + encodeURI(outputString);