Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Chrome 137
Mac OS X 10.15.7
Desktop
one year ago
Benchmark.js
object.assign
11.5M/s
without immutable
9.6M/s
spread
5.2M/s
create new object with assign
533K/s
View exact numbers
Test name Executions per second
object.assign 11,508,653 Ops/sec
without immutable 9,553,102 Ops/sec
spread 5,249,312 Ops/sec
create new object with assign 532,890 Ops/sec
Script Preparation code:
Tests: