Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36
Chrome 111
Windows
Desktop
one year ago
Test name Executions per second
Array.concat 5577193.0 Ops/sec
Array.slice 5815731.0 Ops/sec
For loop 146639.4 Ops/sec
For loop with declared length 219641.8 Ops/sec
While loop 226838.3 Ops/sec
Spread operator 5659186.0 Ops/sec
Slice with begin argument 5802716.0 Ops/sec
Slice with begin and end argument 3620888.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