Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
replaceChildren vs appendChild for empty container
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/121.0.0.0 Safari/537.36
Browser:
Chrome 121
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
appendChild
1.8M/s
replaceChildren
1.6M/s
View exact numbers
Test name
Executions per second
✓
appendChild
1,825,675 Ops/sec
replaceChildren
1,582,352 Ops/sec
HTML Preparation code:
<div id="container"></div>
Script Preparation code:
window.myChild = document.createElement("span"); window.myChild.innerText = "Benchmarking..."; window.theContainer = document.getElementById("container");
Tests:
replaceChildren
window.theContainer.replaceChildren(window.myChild);
appendChild
window.theContainer.appendChild(window.myChild);