Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
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 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0
Browser:
Firefox 122
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
element.textContent
431071.7 Ops/sec
node.textContent
5789094.0 Ops/sec
node.nodeValue
6277673.0 Ops/sec
node.data
6182377.0 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();