servo/tests/blink_perf_tests/perf_tests/layout/nested-grid-lots-of-tracks.html
Jonathan Schwender ee781b71b4
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>
2025-08-17 09:54:04 +00:00

76 lines
2 KiB
HTML
Vendored

<!DOCTYPE html>
<style>
.grid {
display: grid;
}
.grid > div {
grid-area: 1 / 1 / -1 / -1;
}
.auto {
grid-template: repeat(100, auto) / repeat(100, auto);
}
.min-content {
grid-template: repeat(100, min-content) / repeat(100, min-content);
}
.max-content {
grid-template: repeat(100, max-content) / repeat(100, max-content);
}
.flex {
grid-template: repeat(100, 1fr) / repeat(100, 1fr);
}
.percent {
grid-template: repeat(100, 1%) / repeat(100, 1%);
}
.length {
grid-template: repeat(100, 1px) / repeat(100, 1px);
}
</style>
<template id="template">
<div class="grid auto">
<div class="grid min-content">
<div class="grid max-content">
<div class="grid flex">
<div class="grid percent">
<div class="grid length">
<div class="grid auto">
<div class="grid min-content">
<div class="grid max-content">
<div class="grid flex">
<div class="grid percent">
<div class="grid length">
<div>Inner content</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script src="../resources/runner.js"></script>
<script>
'use strict';
function startTest() {
let prototype = document.getElementById("template").content.firstElementChild;
let testcase;
PerfTestRunner.measureRunsPerSecond({
description: "Measures performance of layout on a page using nested grids with lots of tracks.",
setup() {
testcase = prototype.cloneNode(true);
document.body.appendChild(testcase);
},
run() {
testcase.style.display = "none";
PerfTestRunner.forceLayout();
testcase.style.display = "";
PerfTestRunner.forceLayout();
},
});
}
</script>
<body onload="startTest()"></body>