mirror of
https://github.com/servo/servo.git
synced 2025-09-10 15:08:21 +01:00
Vendors the [blink perf tests](https://chromium.googlesource.com/chromium/src/+/HEAD/third_party/blink/perf_tests/). These perf tests are useful to evaluate the performance of servo. The license that governs the perf tests is included in the folder. Running benchmark cases automatically is left to future work. The update.py script is taken from mozjs and slightly adapted, so we can easily filter (and patch if this should be necessary in the future. Testing: This PR just adds the perf_tests, but does not use or modify them in any way. --------- Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
46 lines
1 KiB
HTML
Vendored
46 lines
1 KiB
HTML
Vendored
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<script src="../resources/runner.js"></script>
|
|
<style>
|
|
div { color: grey }
|
|
.a:has(~ .b) { color: green }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id=container><div class=a></div></div>
|
|
<script>
|
|
|
|
function makeTree(siblings) {
|
|
for (var i = 0; i < siblings; i++) {
|
|
var child = document.createElement("div");
|
|
child.classList.add("a");
|
|
child.id = "child" + i;
|
|
container.appendChild(child);
|
|
}
|
|
}
|
|
|
|
makeTree(100);
|
|
container.offsetHeight; // force recalc style
|
|
|
|
var runFunction = function()
|
|
{
|
|
child0.classList.toggle("b");
|
|
container.offsetHeight; // force recalc style
|
|
child0.classList.toggle("b");
|
|
container.offsetHeight; // force recalc style
|
|
|
|
child99.classList.toggle("b");
|
|
container.offsetHeight; // force recalc style
|
|
child99.classList.toggle("b");
|
|
container.offsetHeight; // force recalc style
|
|
}
|
|
|
|
PerfTestRunner.measureRunsPerSecond({
|
|
description: "Measures performance of the '.a:has(~ .b)' invalidation with all subject elements.",
|
|
run: runFunction
|
|
});
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|