Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:77.0) Gecko/20100101 Firefox/77.0
Firefox 77
Mac OS X 10.15
Desktop
3 years ago
Test name Executions per second
Concat 12578360.0 Ops/sec
Concat by spread 9000074.0 Ops/sec
Concat by push 10568190.0 Ops/sec
Add two elements to array by concat 13584860.0 Ops/sec
Add two elements to array by spread 11830640.0 Ops/sec
Add two elements to array by push 65324080.0 Ops/sec
Array to arguments by spread 7274902.0 Ops/sec
Array to arguments by apply 13684260.0 Ops/sec
Array to arguments by apply manually 191136100.0 Ops/sec
Clone array by spread 14734120.0 Ops/sec
Clone array by slice 26406930.0 Ops/sec
Clone object by spread 5632592.0 Ops/sec
Clone object by Object.assign 4142678.0 Ops/sec
Merge objects by spread 2273741.0 Ops/sec
Merge objects by Object.assign 2490891.0 Ops/sec
Merge objects by Object.assign no clone 4708281.0 Ops/sec
Merge objects mannualy 23149240.0 Ops/sec
Add two fields to object by spread 2826833.0 Ops/sec
Add two fields to object mannualy 28180870.0 Ops/sec
Tests:
  • Concat

  • Merge objects mannualy

  • Merge objects by Object.assign no clone

  • Merge objects by Object.assign

  • Merge objects by spread

  • Clone object by Object.assign

  • Clone object by spread

  • Clone array by slice

  • Add two fields to object by spread

  • Clone array by spread

  • Array to arguments by apply

  • Array to arguments by spread

  • Add two elements to array by push

  • Add two elements to array by spread

  • Add two elements to array by concat

  • Concat by push

  • Concat by spread

  • Array to arguments by apply manually

  • Add two fields to object mannualy