Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
textContent vs nodeValue vs data
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Browser:
Chrome 120
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
2 years ago
node.data
1.2M/s
node.textContent
790K/s
node.nodeValue
623K/s
element.textContent
479K/s
View exact numbers
Test name
Executions per second
✓
node.data
1,193,235 Ops/sec
node.textContent
790,304 Ops/sec
node.nodeValue
622,918 Ops/sec
element.textContent
478,565 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();