Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36
Chrome 118
Windows
Desktop
one year ago
Test name Executions per second
Array.concat 5418626.0 Ops/sec
Array.slice 5566100.5 Ops/sec
For loop 150697.7 Ops/sec
For loop with declared length 220154.9 Ops/sec
While loop 242549.5 Ops/sec
Spread operator 5656629.0 Ops/sec
Slice with begin argument 5914673.0 Ops/sec
Slice with begin and end argument 3644243.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