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>
44 lines
1.4 KiB
HTML
Vendored
44 lines
1.4 KiB
HTML
Vendored
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<script src="../resources/runner.js"></script>
|
|
<script src="resources/utils.js"></script>
|
|
<style>
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<script>
|
|
function createDOMChainWithCustomProps(node, depth) {
|
|
if (!depth) {
|
|
return;
|
|
}
|
|
let div = document.createElement("div");
|
|
let style = 'cursor: crosshair;'; // Avoid matched properties cache.
|
|
|
|
let props = [];
|
|
let value = 2**32;
|
|
for (let i = 0; i < 100; ++i) {
|
|
props.push(`--property-with-long-name-and-value-${depth}-${i}: ${value.toString(2)};`);
|
|
// Use a unique value every time to avoid optimization that might
|
|
// utilize identical values.
|
|
value--;
|
|
}
|
|
|
|
div.style = style + props.join('\n');
|
|
node.appendChild(div);
|
|
createDOMChainWithCustomProps(div, depth - 1);
|
|
}
|
|
createDOMChainWithCustomProps(document.body, 1000);
|
|
|
|
PerfTestRunner.measureTime({
|
|
description: 'Measure impact inheriting large numbers of unchanged custom properties.',
|
|
run: function() {
|
|
document.body.style = 'display: none';
|
|
forceStyleRecalc(document.body);
|
|
document.body.style = '';
|
|
forceStyleRecalc(document.body);
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|