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 18_2_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.2 Mobile/15E148 Safari/604.1
Browser:
Mobile Safari 18
Operating system:
iOS 18.2.1
Device Platform:
Mobile
Date tested:
one year ago
element.textContent
4.4M/s
node.data
3.1M/s
node.textContent
3.0M/s
node.nodeValue
3.0M/s
View exact numbers
Test name
Executions per second
✓
element.textContent
4,427,983 Ops/sec
node.data
3,074,688 Ops/sec
node.textContent
3,048,855 Ops/sec
node.nodeValue
3,041,420 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();