Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
textContent vs innerHtml
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 134
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
Benchmark engine:
Benchmark.js
innerHtml
226/s
textContent
4/s
View exact numbers
Test name
Executions per second
✓
innerHtml
226 Ops/sec
textContent
4 Ops/sec
HTML Preparation code:
<div id='test'>Change me</div>
Tests:
textContent
let testElem = document.querySelector("#test"); let i = 2_000_000; while (i--) { testElem.textContent = "HAHAHAHAHA<br>BRBRBR</br>" }
innerHtml
let testElem = document.querySelector("#test"); let i = 2_000_000; while (i--) { testElem.innerHtml = "HAHAHAHAHA<br>BRBRBR</br>" }