Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
innerHTML vs. replaceChildren (iframe insertion) v2
(version: 0)
Comparing performance of:
innerHTML vs replaceChildren
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<div class="adCont"> <p>TestLabel</p> <h2>TestHeadline</h2> </div>
Script Preparation code:
const obj = { width: 300, height: 250, entryPoint: "./path/to/iframe.html", }; const adCont = document.querySelector(".adCont");
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);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
innerHTML
replaceChildren
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Comments
Confirm delete:
Do you really want to delete benchmark?