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 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Browser:
Chrome 137
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
node.nodeValue
2.4M/s
node.data
2.3M/s
node.textContent
2.1M/s
element.textContent
608K/s
View exact numbers
Test name
Executions per second
✓
node.nodeValue
2,398,496 Ops/sec
node.data
2,273,033 Ops/sec
node.textContent
2,117,434 Ops/sec
element.textContent
607,798 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();