Script Preparation code:
Tests:

Historical Performance Data aggregated from 10 community runs

Desktop Results:
Chrome 10 runs
Slice with begin argument
3.8M/s
Spread operator
3.6M/s
Array.slice
3.6M/s
Array.concat
3.4M/s
Slice with begin and end argument
2.5M/s
While loop
154K/s
For loop with declared length
149K/s
For loop
102K/s

Fastest: Slice with begin argument (37.0x faster)

View exact numbers
  • Slice with begin argument: 3,766,500 ops/sec
  • Spread operator: 3,627,908 ops/sec
  • Array.slice: 3,589,992 ops/sec
  • Array.concat: 3,428,044 ops/sec
  • Slice with begin and end argument: 2,450,696 ops/sec
  • While loop: 154,476 ops/sec
  • For loop with declared length: 148,564 ops/sec
  • For loop: 101,931 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    Array.concat
    Array.slice
    For loop
    For loop with declared length
    While loop
    Spread operator
    Slice with begin argument
    Slice with begin and end argument

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Chrome 131 on Windows
View result in a separate tab
Slice with begin argument
3.4M/s
Spread operator
3.3M/s
Array.concat
3.3M/s
Array.slice
3.3M/s
Slice with begin and end argument
2.2M/s
While loop
138K/s
For loop with declared length
130K/s
For loop
93K/s
View exact numbers
Test name Executions per second
Slice with begin argument 3,431,886 Ops/sec
Spread operator 3,327,696 Ops/sec
Array.concat 3,315,430 Ops/sec
Array.slice 3,300,158 Ops/sec
Slice with begin and end argument 2,225,193 Ops/sec
While loop 138,394 Ops/sec
For loop with declared length 129,563 Ops/sec
For loop 92,926 Ops/sec