Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15
Safari 16
Mac OS X 10.15.7
Desktop
2 years ago
Composing objects into new one
476.0M/s
Using the spread operator with two extra variables
21.3M/s
Using the spread operator with constant inside
20.8M/s
Using Object.assign to merge two objects
11.6M/s
Using the spread operator to merge two objects
10.9M/s
View exact numbers
Test name Executions per second
Composing objects into new one 476,012,416 Ops/sec
Using the spread operator with two extra variables 21,341,744 Ops/sec
Using the spread operator with constant inside 20,825,816 Ops/sec
Using Object.assign to merge two objects 11,579,456 Ops/sec
Using the spread operator to merge two objects 10,942,229 Ops/sec
Tests: