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/102.0.5005.115 Safari/537.36 OPR/88.0.4412.65
Browser:
Opera 88
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
replaceChildren
396223.1 Ops/sec
appendChild
335544.5 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);