mirror of
https://github.com/servo/servo.git
synced 2025-09-29 16:19:14 +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>
36 lines
1 KiB
HTML
Vendored
36 lines
1 KiB
HTML
Vendored
<!doctype html>
|
|
<script src="../resources/runner.js"></script>
|
|
<div id="sample"></div>
|
|
<script>
|
|
const kElements = 10000;
|
|
|
|
const metaElements = (() => {
|
|
const result = [];
|
|
for (let count = 0; count < kElements; ++count)
|
|
result.push('<meta>', '</meta>');
|
|
return result;
|
|
})();
|
|
const sample = document.getElementById('sample');
|
|
sample.innerHTML = [
|
|
'<h1 id="before">first line of renderered text</h1>',
|
|
'<div hidden>', ...metaElements, '</div>',
|
|
'<h1 id="target">second line of renderered text</h1>',
|
|
'<div hidden>', ...metaElements, '</div>',
|
|
'<h1 id="after">third line of renderered text</h1>',
|
|
].join('');
|
|
|
|
const selection = window.getSelection();
|
|
|
|
PerfTestRunner.measureTime({
|
|
description: 'Measures performance of move-down through non-renderered elements',
|
|
setup: () => {
|
|
selection.removeAllRanges();
|
|
const target = document.getElementById('target');
|
|
selection.collapse(target.firstChild, 5);
|
|
selection.extend(target.firstChild, 10);
|
|
},
|
|
run: () => {
|
|
selection.modify('extend', 'forward', 'line');
|
|
},
|
|
});
|
|
</script>
|