Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Performance when getting innerHTML vs innerText vs textContent
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:134.0) Gecko/20100101 Firefox/134.0
Browser:
Firefox 134
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
one year ago
innerHtml
779K/s
textContent
2K/s
innerText
106/s
View exact numbers
Test name
Executions per second
✓
innerHtml
778,902 Ops/sec
textContent
2,014 Ops/sec
innerText
106 Ops/sec
HTML Preparation code:
<div id='hello'>Hello, World!</div>
Script Preparation code:
let el = document.querySelector("#hello"); for(let i=0;i<10;i++) { el.innerText = el.innerText + el.innerText; }
Tests:
innerText
let i = 100; let el = document.querySelector("#hello"); let thing = ''; while (i--) { thing += el.innerText; }
innerHtml
let i = 100; let el = document.querySelector("#hello"); let thing = ''; while (i--) { thing += el.innerHtml; }
textContent
let i = 100; let el = document.querySelector("#hello"); let thing = ''; while (i--) { thing += el.textContent; }