Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 YaBrowser/16.9.0.2765 Safari/537.36
Yandex Browser 16
Mac OS X 10.11.6
Other
8 years ago
Test name Executions per second
spreadArray by ertema 380700.0 Ops/sec
spreadArray by kbakba 222853.7 Ops/sec
spreadArray with comparsion and concat 47124.2 Ops/sec
spreadArray with concat only 44351.9 Ops/sec
spreadArray with comparsion only 456502.4 Ops/sec
spreadArrayWithoutComparsionPop 438206.4 Ops/sec
spreadArrayWithoutComparsionShift 412753.3 Ops/sec
spreadArrayWithoutComparsionSlice 367767.7 Ops/sec
Script Preparation code:
Tests:
  • ComparisonAndConcat

  • Concat

  • Comparison

  • Pop

  • Shift

  • Slice

  • TailSlice

  • Slice2

  • For

  • ForReverse

  • ForComparison

  • ForWithInit

  • ForEach