Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Object.assign vs destructuring
(version: 1)
Comparing performance of:
Object.assign vs Destructuring
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
const obj = { one: 'one' }
Tests:
Object.assign
const res = Object.assign({}, { toString: function() { return this.one; }});
Destructuring
const res = {...obj, toString: function() { return this.one; }};
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Object.assign
Destructuring
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
2 months ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:147.0) Gecko/20100101 Firefox/147.0
Browser/OS:
Firefox 147 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Object.assign
27190132.0 Ops/sec
Destructuring
23127676.0 Ops/sec
Related benchmarks:
Variable assignment from object | traditional vs destructuring
Assignment of value vs Destructuring an object
Destructure vs Traditional
Spread vs Object.assign (modify ) vs Object.assign (new)
Object.assign vs direct copy
Object assign vs empty obj
Object.create(null) vs Object literal
Assignment of value vs Destructuring an object (direct assign insted of variable )
Object.assign vs destructuring again
Comments
Confirm delete:
Do you really want to delete benchmark?