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 childNodes = [...document.querySelectorAll("#my-div div")];
  • Array.from

     
    const childNodes = Array.from(document.querySelectorAll("#my-div div"));
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: 5 months ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Chrome 130 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Spread 800.5 Ops/sec
Array.from 842.4 Ops/sec