Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:102.0) Gecko/20100101 Firefox/102.0
Firefox 102
Mac OS X 10.14
Desktop
2 years ago
Test name Executions per second
Array.concat 2656859.0 Ops/sec
Array.slice 10126535.0 Ops/sec
For loop 685605.4 Ops/sec
For loop with declared length 621425.1 Ops/sec
While loop 232280.4 Ops/sec
Spread operator 1737836.6 Ops/sec
Slice with begin argument 10086431.0 Ops/sec
Slice with begin and end argument 10062549.0 Ops/sec
Script Preparation code:
Tests:
  • 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