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; rv:144.0) Gecko/20100101 Firefox/144.0
Browser:
Firefox 144
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
5 months ago
Test name
Executions per second
ChildNodes
1862475.6 Ops/sec
NextSibling
4731784.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)