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>
72 lines
1.8 KiB
HTML
Vendored
72 lines
1.8 KiB
HTML
Vendored
<!DOCTYPE html>
|
|
<title>Contain update layer tree performance</title>
|
|
<style>
|
|
#wrapper {
|
|
position: relative;
|
|
}
|
|
.cell {
|
|
position: absolute;
|
|
box-sizing: border-box;
|
|
border: solid;
|
|
contain: strict;
|
|
}
|
|
.progressbar {
|
|
position: absolute;
|
|
left: 0px;
|
|
top: 5px;
|
|
height: 10px;
|
|
}
|
|
</style>
|
|
<script src="../resources/runner.js"></script>
|
|
<script src="resources/paint.js"></script>
|
|
<pre id="log"></pre>
|
|
<div id="wrapper"></div>
|
|
<script>
|
|
const CELL_WIDTH = "50";
|
|
const CELL_HEIGHT = "25";
|
|
const NUM_ROWS = 120;
|
|
const NUM_COLUMNS = 120;
|
|
const DOM_DEPTH = 10;
|
|
|
|
function createContent(depth) {
|
|
let content = document.createElement("div");
|
|
content.appendChild(document.createElement("h1"));
|
|
content.appendChild(document.createElement("paragraph"));
|
|
if (depth > 0)
|
|
content.appendChild(createContent(depth - 1));
|
|
return content;
|
|
}
|
|
|
|
function setupTest() {
|
|
let wrapper = document.getElementById("wrapper");
|
|
for (let i = 0; i < NUM_ROWS; i++) {
|
|
for (let j = 0; j < NUM_COLUMNS; j++) {
|
|
let cell = document.createElement("div");
|
|
if (i == 0 && j == 0)
|
|
cell.id = "target";
|
|
cell.classList.add("cell");
|
|
cell.style.width = CELL_WIDTH + "px";
|
|
cell.style.height = CELL_HEIGHT + "px";
|
|
cell.style.left = (j * CELL_WIDTH) + "px";
|
|
cell.style.top = (i * CELL_HEIGHT) + "px";
|
|
cell.style.overflow = "visible";
|
|
|
|
cell.appendChild(createContent(DOM_DEPTH));
|
|
|
|
wrapper.appendChild(cell);
|
|
}
|
|
}
|
|
}
|
|
|
|
function runTest() {
|
|
let cell = document.getElementById("target");
|
|
// This causes a call to PaintLayer::SetNeedsCompositingInputsUpdate().
|
|
cell.style.overflow = cell.style.overflow == "hidden" ? "visible" : "hidden";
|
|
}
|
|
|
|
setupTest();
|
|
|
|
measurePaint({
|
|
run: runTest
|
|
});
|
|
</script>
|