Run details:
Mozilla/5.0 (Linux; Android 11; SAMSUNG SM-N975F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/17.0 Chrome/96.0.4664.104 Mobile Safari/537.36
Chrome Mobile 96
Android
Mobile
2 years ago
Test name Executions per second
Array clone with spread operator 6392825.0 Ops/sec
Array clone with slice 6868095.5 Ops/sec
Array addition with spread operator 2304945.8 Ops/sec
Array addition with slice and push 2516468.2 Ops/sec
Array removal with spread operator 1555341.4 Ops/sec
Array removal with slice and splice 3126453.8 Ops/sec
Array update with spread operator 1049134.9 Ops/sec
Script Preparation code:
Tests:
  • Array clone with spread operator

  • Array clone with slice

  • Array addition with spread operator

  • Array addition with slice and push

  • Array removal with spread operator

  • Array removal with slice and splice

  • Array update with spread operator