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 (iPhone; CPU iPhone OS 15_8_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6.6 Mobile/15E148 Safari/604.1
Browser:
Mobile Safari 15
Operating system:
iOS 15.8.2
Device Platform:
Mobile
Date tested:
2 years ago
node.data
1.6M/s
node.textContent
1.6M/s
node.nodeValue
1.5M/s
element.textContent
1.5M/s
View exact numbers
Test name
Executions per second
✓
node.data
1,618,388 Ops/sec
node.textContent
1,594,069 Ops/sec
node.nodeValue
1,535,204 Ops/sec
element.textContent
1,504,664 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();