Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
innerHTML vs insertAdjacentHTML vs appendChild vs append vs insertAdjacentElement
innerHTML vs insertAdjacentHTML vs appendChild vs append vs insertAdjacentElement
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/138.0.0.0 Safari/537.36
Browser:
Chrome 138
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
insertAdjacentHTML
93K/s
innerHTML
92K/s
appendChild
59K/s
insertAdjacentElement
55K/s
append
53K/s
View exact numbers
Test name
Executions per second
✓
insertAdjacentHTML
92,627 Ops/sec
innerHTML
92,132 Ops/sec
appendChild
59,096 Ops/sec
insertAdjacentElement
55,285 Ops/sec
append
53,239 Ops/sec
Script Preparation code:
// Change this number to see how well they scale repeat = 10;
Tests:
innerHTML
const box = document.createElement('div'); let html = ''; for (let i = 0; i < repeat; i++) html += '<div class="a b"><div>Test</div></div>'; box.innerHTML += html;
insertAdjacentHTML
const box = document.createElement('div'); let html = ''; for (let i = 0; i < repeat; i++) html += '<div class="a b"><div>Test</div></div>'; box.insertAdjacentHTML('beforeend', html);
appendChild
const box = document.createElement('div'); const els = []; for (let i = 0; i < repeat; i++) { const div2 = document.createElement('div'); div2.innerText = 'Test'; const div1 = document.createElement('div'); div1.className = 'a b'; div1.appendChild(div2); els.push(div1); } els.forEach(el => box.appendChild(el));
append
const box = document.createElement('div'); const els = []; for (let i = 0; i < repeat; i++) { const div2 = document.createElement('div'); div2.innerText = 'Test'; const div1 = document.createElement('div'); div1.className = 'a b'; div1.append(div2); els.push(div1); } box.append(...els);
insertAdjacentElement
const box = document.createElement('div'); const els = []; for (let i = 0; i < repeat; i++) { const div2 = document.createElement('div'); div2.innerText = 'Test'; const div1 = document.createElement('div'); div1.className = 'a b'; div1.insertAdjacentElement('beforeend', div2); els.push(div1); } els.forEach(el => box.insertAdjacentElement('beforeend', el));