Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Object.assign vs direct assignmentezaeazeza
(version: 0)
Comparing performance of:
Direct Assignment vs Object.assign
Created:
2 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var data = {};
Tests:
Direct Assignment
for(var i = 0; i < 100000; i++) { data[`prop_${i}`] = true; }
Object.assign
for(var i = 0; i < 10000; i++) { var propName = `prop_${i}`; Object.assign(data, { [propName]: true }); }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Direct Assignment
Object.assign
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
object.assign vs spread to create a copy
Object.assign vs direct copy
Object.assign vs spreading object copy
JavaScript: Normal assignation VS Object.assign
Object.assign vs mutation
Comments
Confirm delete:
Do you really want to delete benchmark?