HTML Preparation code:
AخA
 
1
<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);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Spread
    Array.from

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (X11; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0
Firefox 120 on Linux
View result in a separate tab
Test name Executions per second
Spread 2066.6 Ops/sec
Array.from 2049.3 Ops/sec