mirror of
https://github.com/servo/servo.git
synced 2025-09-10 23:18:20 +01:00
tests: Vendor blink perf tests (#38654)
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>
This commit is contained in:
parent
7621332824
commit
ee781b71b4
648 changed files with 359694 additions and 0 deletions
66
tests/blink_perf_tests/perf_tests/layout/nested-subgrid.html
Normal file
66
tests/blink_perf_tests/perf_tests/layout/nested-subgrid.html
Normal file
|
@ -0,0 +1,66 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
div {
|
||||
gap: 5px;
|
||||
padding: 5px;
|
||||
display: inline-grid;
|
||||
border: 2px solid black;
|
||||
}
|
||||
.sub-cols {
|
||||
border-top-style: dashed;
|
||||
border-bottom-style: dashed;
|
||||
grid-template-columns: subgrid;
|
||||
}
|
||||
.sub-rows {
|
||||
border-left-style: dashed;
|
||||
border-right-style: dashed;
|
||||
grid-template-rows: subgrid;
|
||||
}
|
||||
</style>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
"use strict";
|
||||
|
||||
function createSubgrid(n) {
|
||||
if (n == 1) {
|
||||
return document.createElement("div");
|
||||
}
|
||||
|
||||
let subgrid = document.createElement("div");
|
||||
|
||||
let nested_subgrid = createSubgrid(n / 2);
|
||||
nested_subgrid.style.gridArea = `1 / 1 / span ${n} / span ${n}`;
|
||||
nested_subgrid.className = "sub-cols sub-rows";
|
||||
subgrid.appendChild(nested_subgrid);
|
||||
|
||||
nested_subgrid = createSubgrid(n / 2);
|
||||
nested_subgrid.style.gridArea = `1 / ${n + 1} / span ${n} / span ${n}`;
|
||||
nested_subgrid.className = "sub-cols";
|
||||
subgrid.appendChild(nested_subgrid);
|
||||
|
||||
nested_subgrid = createSubgrid(n / 2);
|
||||
nested_subgrid.style.gridArea = `${n + 1} / 1 / span ${n} / span ${n}`;
|
||||
nested_subgrid.className = "sub-rows";
|
||||
subgrid.appendChild(nested_subgrid);
|
||||
|
||||
nested_subgrid = createSubgrid(n / 2);
|
||||
nested_subgrid.style.gridArea = `${n + 1} / ${n + 1} / span ${n} / span ${n}`;
|
||||
subgrid.appendChild(nested_subgrid);
|
||||
|
||||
return subgrid;
|
||||
}
|
||||
|
||||
var run_count = 0;
|
||||
var main = createSubgrid(32);
|
||||
document.body.appendChild(main);
|
||||
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "Measures performance of layout on a page with nested subgrids.",
|
||||
run: function() {
|
||||
main.style.width = (++run_count & 1) ? "99%" : "98%";
|
||||
PerfTestRunner.forceLayout();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
Loading…
Add table
Add a link
Reference in a new issue