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>
41 lines
1,012 B
HTML
Vendored
41 lines
1,012 B
HTML
Vendored
<!DOCTYPE html>
|
|
<title>Bounding box of culled inline</title>
|
|
<script src="../resources/runner.js"></script>
|
|
<body>
|
|
<div id="container" style="width: 800px"></div>
|
|
<script>
|
|
let span_count = 0;
|
|
|
|
function createTree(container, children, depth) {
|
|
container.appendChild(document.createTextNode('text '));
|
|
for (let i = 0; i < children; ++i) {
|
|
const span = document.createElement('span');
|
|
if (depth)
|
|
createTree(span, children, depth - 1);
|
|
container.appendChild(span);
|
|
++span_count;
|
|
}
|
|
}
|
|
|
|
function setup() {
|
|
// Adjust the number of children of each span, and the depth of the tree to
|
|
// ensure we're linear to both of them. crbug.com/1111154
|
|
createTree(container, 5, 5);
|
|
}
|
|
|
|
function test() {
|
|
for (let element of document.getElementsByTagName('span'))
|
|
element.getBoundingClientRect();
|
|
}
|
|
|
|
function run() {
|
|
PerfTestRunner.measureTime({
|
|
description: `Measures performance of bounding box of ${span_count} culled inline.`,
|
|
run: test
|
|
});
|
|
}
|
|
|
|
setup();
|
|
run();
|
|
</script>
|
|
</body>
|