Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
JS: append vs appendChild multiple nodes
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36 Edg/135.0.0.0
Browser:
Chrome 135
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
append
2683.0 Ops/sec
appendChild
3057.2 Ops/sec
document.fragment
1627.6 Ops/sec
HTML Preparation code:
<div id="container"></div>
Script Preparation code:
var paragraphs = Array.from({length: 1000}, () => document.createElement("p")); var container = document.getElementById("container");
Tests:
append
container.append(...paragraphs);
appendChild
for (let i = 0; i < paragraphs.length; i++) { container.appendChild(paragraphs[i]); }
document.fragment
const fragment = new DocumentFragment(); for (let i = 0; i < paragraphs.length; i++) { fragment.append(paragraphs[i]); } container.append(fragment);