Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
ChildNodes vs NextSibling
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
ChildNodes
806046.4 Ops/sec
NextSibling
2721438.0 Ops/sec
Script Preparation code:
var t = document.createElement('template'); t.innerHTML = '<tr><td class="col-md-1"></td><td class="col-md-4"><a></a></td><td class="col-md-1"><a><span class="glyphicon glyphicon-remove" aria-hidden="true" /></a></td><td class="col-md-6" /></tr>'; var template = t.content.firstChild; function childNodes(tree) { let index = 0; const result = {}; const walk = (node) => { result[index++] = node; node.childNodes.forEach(walk); }; walk(tree); return result; } function nextSibling(tree) { let index = 0; const result = {}; const walk = (node) => { result[index++] = node; let child = node.firstChild; while(child) { walk(child); child = child.nextSibling; } }; walk(tree); return result; }
Tests:
ChildNodes
childNodes(template)
NextSibling
nextSibling(template)