Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Safari/605.1.15
Safari 18
Mac OS X 10.15.7
Desktop
one month ago
Test name Executions per second
Array.concat 3454572.0 Ops/sec
Array.slice 4492536.0 Ops/sec
For loop 144876.8 Ops/sec
For loop with declared length 199911.6 Ops/sec
While loop 229194.1 Ops/sec
Spread operator 4029641.0 Ops/sec
Slice with begin argument 4675656.5 Ops/sec
Slice with begin and end argument 3430401.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