зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1374750 - Port stand-alone style-perf-tests into talos as singleton tests, r=jmaher
MozReview-Commit-ID: 3mBVkBUs5of --HG-- extra : rebase_source : ab7f326e492e5b24dfab46c76a4b2804b76dca66
This commit is contained in:
Родитель
5d8117b9de
Коммит
dacd3c80fc
|
@ -77,10 +77,10 @@
|
|||
"talos_options": ["--disable-stylo"]
|
||||
},
|
||||
"perf-reftest-singletons-e10s": {
|
||||
"tests": ["bloom_basic_singleton"]
|
||||
"tests": ["perf_reftest_singletons"]
|
||||
},
|
||||
"perf-reftest-singletons-stylo-disabled-e10s": {
|
||||
"tests": ["bloom_basic_singleton"],
|
||||
"tests": ["perf_reftest_singletons"],
|
||||
"talos_options": ["--disable-stylo"]
|
||||
},
|
||||
"tp5o-e10s": {
|
||||
|
|
|
@ -822,13 +822,14 @@ class bloom_basic(PageloaderTest):
|
|||
|
||||
|
||||
@register_test()
|
||||
class bloom_basic_singleton(PageloaderTest):
|
||||
class perf_reftest_singletons(PageloaderTest):
|
||||
"""
|
||||
Stylo bloom_basic: runs bloom_basic and bloom_basic_ref and reports difference
|
||||
Style perf-reftests run as individual tests
|
||||
"""
|
||||
tpmanifest = '${talos}/tests/perf-reftest-singletons/bloom_basic_singleton.manifest'
|
||||
tpmanifest = '${talos}/tests/perf-reftest-singletons/perf_reftest_singletons.manifest'
|
||||
tpcycles = 1
|
||||
tppagecycles = 25
|
||||
tppagecycles = 15
|
||||
tptimeout = 30000
|
||||
gecko_profile_interval = 1
|
||||
gecko_profile_entries = 2000000
|
||||
filters = filter.ignore_first.prepare(5) + filter.median.prepare()
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rules": {
|
||||
"no-undef": "off"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="util.js"></script>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
/* Use many rules, instead of one rule with many selectors, to test per-rule overhead. */
|
||||
document.head.appendChild(build_rule("caption div, caption span", 1, "{ color: blue; } ", 20000));
|
||||
let dom = build_dom(5000, "div");
|
||||
|
||||
flush_style();
|
||||
perf_start();
|
||||
document.body.appendChild(dom);
|
||||
flush_style(dom);
|
||||
perf_finish();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
|
@ -1,10 +1,6 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script>
|
||||
/* globals build_rule build_dom flush_style perf_start perf_finish */
|
||||
/* eslint no-undef: "error" */
|
||||
</script>
|
||||
<script src="util.js"></script>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
% http://localhost/tests/perf-reftest-singletons/bloom-basic.html
|
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
.x { color: yellow; }
|
||||
</style>
|
||||
<script src="util.js"></script>
|
||||
<script>
|
||||
function set_class(n) {
|
||||
n.className = "x";
|
||||
n = n.firstChild;
|
||||
while (n) {
|
||||
set_class(n);
|
||||
n = n.nextSibling;
|
||||
}
|
||||
}
|
||||
window.onload = function() {
|
||||
let root = build_dom(50000, "div");
|
||||
document.body.appendChild(root);
|
||||
flush_style(root);
|
||||
perf_start();
|
||||
set_class(root);
|
||||
flush_style(root);
|
||||
perf_finish();
|
||||
};
|
||||
</script>
|
||||
<body></body>
|
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
.x { color: yellow; }
|
||||
</style>
|
||||
<script src="util.js"></script>
|
||||
<script>
|
||||
function set_class(n) {
|
||||
let child = n.firstChild;
|
||||
while (child) {
|
||||
set_class(child);
|
||||
child = child.nextSibling;
|
||||
}
|
||||
n.className = "x";
|
||||
}
|
||||
window.onload = function() {
|
||||
let root = build_dom(50000, "div");
|
||||
document.body.appendChild(root);
|
||||
flush_style(root);
|
||||
set_class(root);
|
||||
perf_start();
|
||||
flush_style(root);
|
||||
perf_finish();
|
||||
};
|
||||
</script>
|
||||
<body></body>
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
.root { display: none; }
|
||||
.x div { color: blue; }
|
||||
</style>
|
||||
<script src="util.js"></script>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
let root = document.createElement("div");
|
||||
root.className = "root";
|
||||
root.appendChild(build_dom(100000, "div"));
|
||||
document.body.appendChild(root);
|
||||
flush_style(root);
|
||||
perf_start();
|
||||
document.body.className = "x";
|
||||
flush_style(root);
|
||||
perf_finish();
|
||||
};
|
||||
</script>
|
||||
<body></body>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
.x > div, .x > span { background-color: yellow; }
|
||||
</style>
|
||||
<script src="util.js"></script>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
let root = document.createElement("div");
|
||||
root.appendChild(build_dom(100000, "div"));
|
||||
document.body.appendChild(root);
|
||||
flush_style(root);
|
||||
perf_start();
|
||||
root.className = "x";
|
||||
flush_style(root);
|
||||
perf_finish();
|
||||
};
|
||||
</script>
|
||||
<body></body>
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="util.js"></script>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
document.head.appendChild(build_rule("body > .foo > .foo > .foo", 1000, "{ color: blue; } "));
|
||||
let dom = build_dom(5000, "div", { attributes: {"class": "foo" } });
|
||||
|
||||
flush_style();
|
||||
perf_start();
|
||||
document.body.appendChild(dom);
|
||||
flush_style(dom);
|
||||
perf_finish();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,13 @@
|
|||
% http://localhost/tests/perf-reftest-singletons/bloom-basic.html
|
||||
% http://localhost/tests/perf-reftest-singletons/bloom-basic-2.html
|
||||
% http://localhost/tests/perf-reftest-singletons/style-sharing.html
|
||||
% http://localhost/tests/perf-reftest-singletons/style-sharing-style-attr.html
|
||||
% http://localhost/tests/perf-reftest-singletons/display-none-1.html
|
||||
% http://localhost/tests/perf-reftest-singletons/only-children-1.html
|
||||
% http://localhost/tests/perf-reftest-singletons/slow-selector-1.html
|
||||
% http://localhost/tests/perf-reftest-singletons/slow-selector-2.html
|
||||
% http://localhost/tests/perf-reftest-singletons/style-attr-1.html
|
||||
% http://localhost/tests/perf-reftest-singletons/coalesce-1.html
|
||||
% http://localhost/tests/perf-reftest-singletons/coalesce-2.html
|
||||
% http://localhost/tests/perf-reftest-singletons/parent-basic-singleton.html
|
||||
% http://localhost/tests/perf-reftest-singletons/tiny-traversal-singleton.html
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
.first:empty { color: blue; }
|
||||
</style>
|
||||
<script src="util.js"></script>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
let root = document.createElement("div");
|
||||
let first = document.createElement("div");
|
||||
first.className = "first";
|
||||
first.appendChild(document.createElement("div"));
|
||||
root.appendChild(first);
|
||||
root.appendChild(build_dom(64000, "div"));
|
||||
document.body.appendChild(root);
|
||||
flush_style(root);
|
||||
perf_start();
|
||||
first.firstChild.remove();
|
||||
flush_style(root);
|
||||
perf_finish();
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
.first:first-child { color: blue; }
|
||||
</style>
|
||||
<script src="util.js"></script>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
let root = document.createElement("div");
|
||||
root.appendChild(document.createElement("div"));
|
||||
let first = document.createElement("div");
|
||||
first.className = "first";
|
||||
root.appendChild(first);
|
||||
root.appendChild(build_dom(64000, "div"));
|
||||
document.body.appendChild(root);
|
||||
flush_style(root);
|
||||
perf_start();
|
||||
root.firstChild.remove();
|
||||
flush_style(root);
|
||||
perf_finish();
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="util.js"></script>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
document.head.appendChild(build_rule(".x[y~='e500']", 100000, "{ color: blue; }"));
|
||||
var div = document.createElement("div");
|
||||
div.className = "x";
|
||||
let val = "";
|
||||
for (let i = 0; i < 1000; i++) {
|
||||
val += "e" + i + " ";
|
||||
}
|
||||
div.setAttribute("y", val);
|
||||
document.body.appendChild(div);
|
||||
flush_style(div);
|
||||
perf_start();
|
||||
div.style.color = "green";
|
||||
flush_style(div);
|
||||
perf_finish();
|
||||
};
|
||||
</script>
|
||||
<body></body>
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="util.js"></script>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
document.head.appendChild(build_rule("caption div", 10000, "{ color: blue; } "));
|
||||
let dom = build_dom(5000, "div", { elemNameLeft: "div", elemNameRight: "div",
|
||||
attributes: { style: "background-color: yellow;"} });
|
||||
|
||||
flush_style();
|
||||
perf_start();
|
||||
document.body.appendChild(dom);
|
||||
flush_style(dom);
|
||||
perf_finish();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="util.js"></script>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
document.head.appendChild(build_rule("caption div", 10000, "{ color: blue; } "));
|
||||
let dom = build_dom(5000, "div", { elemNameLeft: "div", elemNameRight: "div" });
|
||||
|
||||
flush_style();
|
||||
perf_start();
|
||||
document.body.appendChild(dom);
|
||||
flush_style(dom);
|
||||
perf_finish();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="util.js"></script>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
document.head.appendChild(build_rule("caption#foo", 1, "{ color: blue; } "));
|
||||
let dom = build_dom(2048, "div");
|
||||
let p = dom;
|
||||
for (var i = 0; i < 5; ++i ) {
|
||||
p = p.firstChild.lastChild;
|
||||
}
|
||||
let elem = document.createElement("caption");
|
||||
p.appendChild(elem);
|
||||
document.body.appendChild(dom);
|
||||
flush_style();
|
||||
|
||||
perf_start();
|
||||
var state = true;
|
||||
for (i = 0; i < 100000; ++i) {
|
||||
elem.setAttribute("id", state ? "" : "foo");
|
||||
state = !state;
|
||||
window.getComputedStyle(elem).color;
|
||||
}
|
||||
perf_finish();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче