Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Benchmark cloning methodsasdasd
(version: 0)
Comparing performance of:
Lodash cloneDeep vs Object create vs desc vs proto
Created:
7 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
var MyObject = { description: 'Creates a deep copy of source, which should be an object or an array.', myNumber: 123456789, myBoolean: true, myDate: new Date(), myDate2: new Date(), myDate3: new Date(), myDate4: new Date(), myDate5: new Date(), myDate6: new Date(), myDate7: new Date(), myDate8: new Date(), myDate9: new Date(), myDate10: new Date(), jayson: { stringify: 'JSON.stringify() method converts a JavaScript value to a JSON string....', parse: 'JSON.parse() method parses a JSON string...' }, jayson2: { stringify: 'JSON.stringify() method converts a JavaScript value to a JSON string....', parse: 'JSON.parse() method parses a JSON string...' }, jayson3: { stringify: 'JSON.stringify() method converts a JavaScript value to a JSON string....', parse: 'JSON.parse() method parses a JSON string...' }, jayson4: { stringify: 'JSON.stringify() method converts a JavaScript value to a JSON string....', parse: 'JSON.parse() method parses a JSON string...' }, jayson5: { stringify: 'JSON.stringify() method converts a JavaScript value to a JSON string....', parse: 'JSON.parse() method parses a JSON string...' }, jayson6: { stringify: 'JSON.stringify() method converts a JavaScript value to a JSON string....', parse: 'JSON.parse() method parses a JSON string...' }, jayson7: { stringify: 'JSON.stringify() method converts a JavaScript value to a JSON string....', parse: 'JSON.parse() method parses a JSON string...' }, jayson8: { stringify: 'JSON.stringify() method converts a JavaScript value to a JSON string....', parse: 'JSON.parse() method parses a JSON string...' } }; var myCopy = null;
Tests:
Lodash cloneDeep
myCopy = _.cloneDeep(MyObject);
Object create
myCopy = Object.create( Object.getPrototypeOf(MyObject), Object.getOwnPropertyDescriptors(MyObject))
desc
Object.getOwnPropertyDescriptors(MyObject)
proto
Object.getPrototypeOf(MyObject)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
Lodash cloneDeep
Object create
desc
proto
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:
Lodash clone vs cloneDeep
Benchmark cloning methods
Lodash cloneDeep vs JSON Clone with date
JSON.stringify vs structuredClone vs cloneLineageData vs cloneDeep
Comments
Confirm delete:
Do you really want to delete benchmark?