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:
3 months ago
Test name
Executions per second
innerText
8010.4 Ops/sec
innerHtml
1446560.9 Ops/sec
textContent
187962.8 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; }