Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
innerHTML vs. replaceChildren (iframe insertion) v3
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/126.0.0.0 Safari/537.36
Browser:
Chrome 126
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
innerHTML
2033.0 Ops/sec
replaceChildren
1968.2 Ops/sec
HTML Preparation code:
<div class="adCont"> <p>TestLabel</p> <h2>TestHeadline</h2> </div> <script> const obj = { width: 300, height: 250, entryPoint: "./path/to/iframe.html", }; const adCont = document.querySelector(".adCont"); </script>
Tests:
innerHTML
adCont.innerHTML = `<iframe width="${obj.width}" height="${obj.height}" src="${obj.entryPoint}"></iframe>`;
replaceChildren
const ADiframe = document.createElement("iframe"); ADiframe.width = obj.width; ADiframe.height = obj.height; ADiframe.src = obj.entryPoint; adCont.replaceChildren(ADiframe);