Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0
Firefox 94
Linux
Desktop
3 years ago
Test name Executions per second
Array.concat 2882085.5 Ops/sec
Array.slice 12845773.0 Ops/sec
For loop 2527427.5 Ops/sec
For loop with declared length 2755312.2 Ops/sec
While loop 2824483.8 Ops/sec
Spread operator 2305856.8 Ops/sec
Slice with begin argument 12986816.0 Ops/sec
Slice with begin and end argument 12474829.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