Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
textContent vs nodeValue vs data (same-level)
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4.1 Safari/605.1.15
Browser:
Safari 17
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
2 years ago
Benchmark engine:
Benchmark.js
node.textContent
2.7M/s
node.nodeValue
2.7M/s
node.data
2.6M/s
element.textContent
1.9M/s
View exact numbers
Test name
Executions per second
✓
node.textContent
2,716,122 Ops/sec
node.nodeValue
2,692,836 Ops/sec
node.data
2,616,928 Ops/sec
element.textContent
1,940,736 Ops/sec
HTML Preparation code:
<div id="el"> </div>
Script Preparation code:
var a = document.querySelector('#el'); var a1 = a.firstChild;
Tests:
element.textContent
a.textContent = Math.random();
node.textContent
a1.textContent = Math.random();
node.nodeValue
a1.nodeValue = Math.random();
node.data
a1.data = Math.random();