* housekeeping: refine test utils * setup benchmark tests * improve snapshot attributes loop perf
28 lines
804 B
HTML
28 lines
804 B
HTML
<html>
|
|
<body></body>
|
|
<script>
|
|
window.workload = () => {
|
|
const branches = 1000;
|
|
const depth = 10;
|
|
const frag = document.createDocumentFragment();
|
|
for (let b = 0; b < branches; b++) {
|
|
const node = document.createElement('div');
|
|
let d = 0;
|
|
node.setAttribute('branch', b.toString());
|
|
node.setAttribute('depth', d.toString());
|
|
let current = node;
|
|
while (d < depth - 1) {
|
|
d++;
|
|
const child = document.createElement('div');
|
|
child.setAttribute('branch', b.toString());
|
|
child.setAttribute('depth', d.toString());
|
|
current.appendChild(child);
|
|
current = child;
|
|
}
|
|
frag.appendChild(node);
|
|
}
|
|
document.body.appendChild(frag);
|
|
};
|
|
</script>
|
|
</html>
|