Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
textContent vs nodeValue vs data vs inner html
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
element.innerHtml
45.2M/s
node.nodeValue
1.2M/s
node.data
1.2M/s
node.textContent
1.1M/s
element.textContent
367K/s
View exact numbers
Test name
Executions per second
✓
element.innerHtml
45,248,768 Ops/sec
node.nodeValue
1,175,060 Ops/sec
node.data
1,156,417 Ops/sec
node.textContent
1,078,188 Ops/sec
element.textContent
366,544 Ops/sec
HTML Preparation code:
<div id="el"> </div>
Script Preparation code:
var a = document.querySelector('#el');
Tests:
element.textContent
a.textContent = Math.random();
node.textContent
a.firstChild.textContent = Math.random();
node.nodeValue
a.firstChild.nodeValue = Math.random();
node.data
a.firstChild.data = Math.random();
element.innerHtml
a.innerHtml = Math.random();