Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Spread vs Array.from on NodeList
Create array from Node.childNodes
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0
Browser:
Firefox 120
Operating system:
Linux
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
Spread
2066.6 Ops/sec
Array.from
2049.3 Ops/sec
HTML Preparation code:
<div id="my-div"></div>
Script Preparation code:
const div = document.getElementById("my-div"); for (let i = 0; i < 10000; i++) { const child = document.createElement("div"); child.append(`I'm div-${i}`); div.append(child); }
Tests:
Spread
const div = document.getElementById("my-div"); const childNodes = [...div.childNodes];
Array.from
const div = document.getElementById("my-div"); const childNodes = Array.from(div.childNodes);