Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
createTextNode vs append vs prepend vs innerHTML vs innerText vs textContent
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0
Browser:
Firefox 131
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
prepend
1.5M/s
innerHTML
602K/s
textContent
600K/s
innerText
553K/s
createTextNode
1K/s
append
594/s
View exact numbers
Test name
Executions per second
✓
prepend
1,489,749 Ops/sec
innerHTML
602,239 Ops/sec
textContent
600,481 Ops/sec
innerText
552,668 Ops/sec
createTextNode
1,232 Ops/sec
append
594 Ops/sec
HTML Preparation code:
<div id='a'></div>
Script Preparation code:
var a = document.getElementById('a');
Tests:
createTextNode
a.appendChild(document.createTextNode('text'));
append
a.append('text');
prepend
a.prepend('text');
innerHTML
a.innerHTML = 'text';
innerText
a.innerText = 'text';
textContent
a.textContent = 'text';