Script Preparation code:
Tests:
  • foreach

  • for

  • map

  • for..of

  • slice + [x, ...y]

  • for (no slice)

  • for + push

  • slice + [x, ...y] v2

  • slice + [x, ...y] v3

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    foreach
    for
    map
    for..of
    slice + [x, ...y]
    for (no slice)
    for + push
    slice + [x, ...y] v2
    slice + [x, ...y] v3

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 OPR/112.0.0.0
Opera 112 on Windows
View result in a separate tab
Test name Executions per second
foreach 23487.2 Ops/sec
for 11938.3 Ops/sec
map 22811.2 Ops/sec
for..of 21701.9 Ops/sec
slice + [x, ...y] 18631.7 Ops/sec
for (no slice) 7851.7 Ops/sec
for + push 7491.2 Ops/sec
slice + [x, ...y] v2 18574.8 Ops/sec
slice + [x, ...y] v3 18667.1 Ops/sec