Test case name | Result |
---|---|
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 |
Test name | Executions per second |
---|---|
Concat | 12578360.0 Ops/sec |
Concat by spread | 9000074.0 Ops/sec |
Concat by push | 10568185.0 Ops/sec |
Add two elements to array by concat | 13584859.0 Ops/sec |
Add two elements to array by spread | 11830641.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 | 13684255.0 Ops/sec |
Array to arguments by apply manually | 191136080.0 Ops/sec |
Clone array by spread | 14734124.0 Ops/sec |
Clone array by slice | 26406934.0 Ops/sec |
Clone object by spread | 5632592.0 Ops/sec |
Clone object by Object.assign | 4142677.8 Ops/sec |
Merge objects by spread | 2273740.5 Ops/sec |
Merge objects by Object.assign | 2490890.5 Ops/sec |
Merge objects by Object.assign no clone | 4708281.0 Ops/sec |
Merge objects mannualy | 23149238.0 Ops/sec |
Add two fields to object by spread | 2826833.0 Ops/sec |
Add two fields to object mannualy | 28180868.0 Ops/sec |