Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
JavaScript spread operator vs object update performance test fork
(version: 1)
Comparing performance of:
Using update vs Using Object.assign
Created:
6 months ago
by:
Guest
Go to the latest result
Tests:
Using update
const firstObject = { sampleData: 'Hello world' } const secondObject = { moreData: 'foo bar' } const finalObject = {...firstObject, ...secondObject}
Using Object.assign
const firstObject = { sampleData: 'Hello world' } const secondObject = { moreData: 'foo bar' } const finalObject = Object.assign(firstObject, secondObject);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Using update
Using Object.assign
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
6 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36
Browser/OS:
Chrome 144 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Using Object.assign
63.0M/s
Using update
54.7M/s
View exact numbers
Test name
Executions per second
✓
Using Object.assign
62,953,920 Ops/sec
Using update
54,724,712 Ops/sec
Related benchmarks
JavaScript spread operator vs object update performance
JavaScript spread operator vs object update vs object assign performance
Comments
Confirm delete:
Do you really want to delete benchmark?