Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
innerHTML vs. replaceChildren (iframe insertion)
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:135.0) Gecko/20100101 Firefox/135.0
Browser:
Firefox 135
Operating system:
Ubuntu
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
innerHTML
647.4 Ops/sec
replaceChildren
605.5 Ops/sec
HTML Preparation code:
<div class="adCont"> <p>TestLabel</p> <h2>TestHeadline</h2> </div>
Tests:
innerHTML
const adCont = document.querySelector(".adCont"); const obj = { width: 300, height: 250, entryPoint: "./path/to/iframe.html", }; adCont.innerHTML = `<iframe width="${obj.width}" height="${obj.height}" src="${obj.entryPoint}"></iframe>`;
replaceChildren
const adCont = document.querySelector(".adCont"); const obj = { width: 300, height: 250, entryPoint: "./path/to/iframe.html", }; const ADiframe = document.createElement("iframe"); ADiframe.width = obj.width; ADiframe.height = obj.height; ADiframe.src = obj.entryPoint; adCont.replaceChildren(ADiframe);