Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Object.assign vs JSON Clone
(version: 0)
Comparing performance of:
Json clone vs Object.assign
Created:
4 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var MyObject = { description: 'Creates a deep copy of source, which should be an object or an array.', myNumber: 123456789, myBoolean: true, jayson: { stringify: 'JSON.stringify() method converts a JavaScript value to a JSON string....', parse: 'JSON.parse() method parses a JSON string...' } }; var myCopy = null;
Tests:
Json clone
myCopy = JSON.parse(JSON.stringify(MyObject));
Object.assign
myCopy = Object.assign({}, MyObject);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Json clone
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:
JS object copy spread vs assign
Deep Clone Object: JSON.parse vs Object.assign
Object.assign vs direct copy
Object copy JSON vs Object.assign
lodash clonedeep vs json.parse(stringify()) vs recursivecopy vs structured clone
Comments
Confirm delete:
Do you really want to delete benchmark?