Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
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
Test name
Executions per second
createTextNode
1232.2 Ops/sec
append
593.5 Ops/sec
prepend
1489749.0 Ops/sec
innerHTML
602238.6 Ops/sec
innerText
552668.2 Ops/sec
textContent
600480.8 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';