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
Test name
Executions per second
replaceChildren
1582352.1 Ops/sec
appendChild
1825674.6 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);