Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15
Safari 17
Mac OS X 10.15.7
Desktop
5 months ago
Test name Executions per second
Array.concat 7593878.0 Ops/sec
Array.slice 11183018.0 Ops/sec
For loop 409597.9 Ops/sec
For loop with declared length 622836.2 Ops/sec
While loop 617641.9 Ops/sec
Spread operator 8792815.0 Ops/sec
Slice with begin argument 11567483.0 Ops/sec
Slice with begin and end argument 8703245.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