Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36
Chrome 106
Windows
Desktop
2 years ago
Test name Executions per second
Array.concat 10588799.0 Ops/sec
Array.slice 11184400.0 Ops/sec
For loop 192640.0 Ops/sec
For loop with declared length 361355.1 Ops/sec
While loop 360534.7 Ops/sec
Spread operator 9712719.0 Ops/sec
Slice with begin argument 10206404.0 Ops/sec
Slice with begin and end argument 4846466.5 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