Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
JavaScript spread operator vs object update performance 2
(version: 1)
Comparing performance of:
Using update vs Using Object.assign
Created:
one year ago
by:
Guest
Go to the latest result
Tests:
Using update
const firstObject = {} firstObject.sample1 = 'Hello world'; firstObject.sample2 = 'foo bar';
Using Object.assign
const firstObject = { } const secondObject = { ...firstObject, sample1: 'foo bar' } const finalObject = { ...secondObject, sample2: 'Hello world' }
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:
one year ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Browser/OS:
Chrome 132 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
Using update
119.4M/s
Using Object.assign
34.6M/s
View exact numbers
Test name
Executions per second
✓
Using update
119,415,592 Ops/sec
Using Object.assign
34,574,624 Ops/sec
Comments
Confirm delete:
Do you really want to delete benchmark?