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 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Browser:
Chrome 134
Operating system:
Linux
Device Platform:
Desktop
Date tested:
6 months ago
innerHtml
1.4M/s
textContent
188K/s
innerText
8K/s
View exact numbers
Test name
Executions per second
✓
innerHtml
1,446,561 Ops/sec
textContent
187,963 Ops/sec
innerText
8,010 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; }