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:
Jonathan Schwender 2025-08-17 11:54:04 +02:00 committed by GitHub
parent 7621332824
commit ee781b71b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
648 changed files with 359694 additions and 0 deletions

View file

@ -0,0 +1,3 @@
bokan@chromium.org
khushalsagar@chromium.org
vmpstr@chromium.org

View file

@ -0,0 +1,45 @@
<!DOCTYPE html>
<html>
<head>
<style>
html { view-transition-name: unset }
#target {
height: 100000px;
width: 1000px;
position: absolute;
background: lightblue;
contain: layout;
view-transition-name: target;
}
.left {
left: 8px;
}
.right {
right: 8px;
}
::view-transition-group(*) {
animation-duration: 0s;
}
</style>
<script src="../resources/runner.js"></script>
<script>
function startTest() {
var transition;
PerfTestRunner.measureFrameTime({
description: "Measures performance starting/finishing a transition with a large element",
setup: () => {
transition = document.startViewTransition(() => {
target.classList.toggle("left");
target.classList.toggle("right");
});
},
run: async () => { await transition.finished },
done: () => {}
});
}
</script>
</head>
<body onload="startTest()">
<div id=target class=left>This is a div!</div>
<div id="log"></div>
</body></html>

View file

@ -0,0 +1,52 @@
<!DOCTYPE html>
<html>
<head>
<style>
html { view-transition-name: unset }
#container > * {
contain: layout;
display: inline-block;
border: 1px solid black;
width: 20px;
height: 20px;
}
.green > * {
background: green;
}
.blue > * {
background: blue;
}
::view-transition-group(*) {
animation-duration: 0s;
}
</style>
<script src="../resources/runner.js"></script>
<script>
const kCount = 1500;
function startTest() {
var transition;
for (let i = 0; i < kCount; i++) {
let e = document.createElement("div");
e.viewTransitionName = "e" + i;
container.appendChild(e);
}
PerfTestRunner.measureFrameTime({
description: "Measures performance starting/finishing a transition with many small elements",
setup: () => {
transition = document.startViewTransition(() => {
container.classList.toggle("green");
container.classList.toggle("blue");
});
},
run: async () => { await transition.finished },
done: () => {}
});
}
</script>
</head>
<body onload="startTest()">
<div id=container class=green></div>
<div id="log"></div>
</body></html>