Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
DOM manipulation vs innerhtml long - 1
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/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
innerHTML
90990.6 Ops/sec
DOM manipulation
63245.0 Ops/sec
HTML Preparation code:
<div id="root"></div>
Tests:
innerHTML
let root = document.querySelector('#root') root.innerHTML = `<div id="4/4b809ca8-b600-a286-62b6-83a6a5fc4310" style="left: 0px; top: 0px; white-space: nowrap;"> <span class="testing">0</span> <span class="testing">1</span> <span class="testing">2</span> <span class="testing">3</span> <span class="testing">4</span> </div>`
DOM manipulation
let root = document.querySelector('#root') let itemBox = document.createElement('div') itemBox.id = "4/4b809ca8-b600-a286-62b6-83a6a5fc4310" itemBox.style = "left: 0px; top: 0px; white-space: nowrap;" for (let i=0; i<5;i++) { let itemSpan = document.createElement('span') itemSpan.className = "testing"; itemSpan.innerText = i; itemBox.appendChild(itemSpan); } root.appendChild(itemBox)