blob: 5e7b870ae2271fcf20aa77d4040cbe7db0aa1689 [file] [log] [blame]
<!DOCTYPE html>
<script src="../resources/runner.js"></script>
<div id="container"></div>
<script>
'use strict';
PerfTestRunner.measureRunsPerSecond({
description: 'Adds, then lays out, a long list of sibling elements ' +
'separated by spaces',
setup: () => {
container.parentNode.replaceChild(container.cloneNode(false), container);
PerfTestRunner.gc();
},
run: () => {
const num_words = 300;
for (var i = 0; i < num_words; i++) {
var a = document.createElement('a');
a.appendChild(document.createTextNode('' + i));
container.appendChild(a);
container.appendChild(document.createTextNode(' '));
}
PerfTestRunner.forceLayout();
}
});
</script>