Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36
Chrome 83
Windows
Desktop
4 years ago
Test name Executions per second
Array.prototype.slice -- long -- no additions 9211.0 Ops/sec
spread operator -- long -- no additions 10279.6 Ops/sec
Array.prototype.slice -- long -- add another 2828.9 Ops/sec
spread operator -- long -- add another 1400.8 Ops/sec
Array.prototype.slice -- short -- no additions 10097662.0 Ops/sec
spread operator -- short -- no additions 9589077.0 Ops/sec
Array.prototype.slice -- short -- add a few 3433518.5 Ops/sec
spread operator -- short -- add a few 7679565.5 Ops/sec
Script Preparation code:
Tests:
  • Array.prototype.slice -- long -- no additions

  • spread operator -- long -- no additions

  • Array.prototype.slice -- long -- add another

  • spread operator -- long -- add another

  • Array.prototype.slice -- short -- no additions

  • spread operator -- short -- no additions

  • Array.prototype.slice -- short -- add a few

  • spread operator -- short -- add a few


;