Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Lodash cloneDeep vs JSON Clone 22222
(version: 0)
Comparing performance of:
Lodash cloneDeep vs Json clone vs ramda
Created:
6 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 src='https://cdnjs.cloudflare.com/ajax/libs/ramda/0.26.1/ramda.min.js'></script>
Script Preparation code:
var MyObject = { '27abdbf4-f6b8-11e7-99e8-49ff5466525e': { attributes: { ArticleCode: { ToSaveDataTo: '12' }, Brand: { AmazonAPI: { en: 'Epson' } }, Category1: { AmazonAPI: { en: 'CE' }, TechData: { en: 'Supplies' }, ToSaveDataTo: { en: 'CE2' } }, Category2: { AmazonAPI: { en: 'Electronics' }, TechData: { en: 'Paper - Printers' } }, Category3: { TechData: { en: 'Office Paper & Film' } }, Description: { TechData: { en: 'Paper/Photo Quality A3+102gm2 100sh' } }, EAN: '0010343812048', Label: { AmazonAPI: { en: 'Epson' } }, Manufacturer: { AmazonAPI: { en: 'Epson' }, TechData: { en: 'Epson' } }, ModelNumber: { ToSaveDataTo: '11' }, MPN: { AmazonAPI: 'C13S041069' }, Price: { TechData: '36,15' }, Title: { AmazonAPI: { en: 'Epson A3+ Photo Quality Inkjet Paper 100 Sheets - White' }, ToSaveDataTo: { nl: 'product' } }, VendorPartNumber: 'C13S041069' }, createdAt: '2018-01-11T10:14:05+00:00', updatedAt: '2019-05-17T09:52:25+00:00', status: null, vendorPartNumber: 'C13S041069', eanCode: '0010343812048', id: '27abdbf4-f6b8-11e7-99e8-49ff5466525e', categories: [ '00dde55c-6db9-11e9-8963-eff82f36df03', '01909508-6db9-11e9-9355-e74c0d58763b' ], favourite: false }, '2e0d0714-06a0-11e8-84e4-f5036771bf95': { attributes: { Brand: { AmazonAPI: { en: 'LEGO UK' }, WaveData: { nl: 'LEGO' } }, Category1: { AmazonAPI: { en: 'Toy' }, WaveData: { nl: 'Speelgoed' } }, Category2: { AmazonAPI: { en: 'Toy' } }, Category3: { WaveData: { nl: '1SSLKW0P' } }, Cost: { WaveData: { nl: '24,79' } }, DeepLearning: { AKAdmin_personal: { en: '12345\n' }, ToSaveDataTo: { nl: 'illustratie, plezier, volk, vrouw, mannelijk, sport, symbool, afbeelding, teken, rondje, wereldwijd web, design (decoratie), internet, vector (rechte lijn), communicatie, bedrijfsleven, controleren, element, verbod, geïsoleerd, verboden, reeks, contact (communicatie)' } }, DetailedURL: { AmazonAPI: 'https://www.amazon.co.uk/LEGO-41597-Brick-Headz-Building/dp/B075T2P9JS' }, Dimensions: { AmazonHTML: '262 x 95 x 222 cm' }, EAN: '5702016072624', ImageUrl: { AmazonAPI: 'https://images-eu.ssl-images-amazon.com/images/I/61nngvH9eCL.jpg', WaveData: 'https://www.wave-distributie.nl/pix/product/missingProdpic/noPic230x230.png' }, ImageUrl2: { ToSaveDataTo: { nl: 'https://www.amazon.co.uk/LEGO-41597-Brick-Headz-Building/dp/B075T2P9JS' } }, ItemWeight: { AmazonHTML: '658 g', WaveData: '500 gram' }, Label: { AmazonAPI: { en: 'LEGO' }, WaveData: { nl: 'Brick Headz Brick me' } }, Manufacturer: { AmazonAPI: { en: 'LEGO' } }, ModelNumber: { AmazonAPI: '41597', AmazonHTML: '41597' }, MPN: { AmazonAPI: '41597' }, Price: { AmazonHTML: '£24.80', WaveData: '24,79' }, Quantity: { AKAdmin_personal: '122' }, SourceOwnID: { AmazonHTML: 'B075T2P9JS', WaveData: '1SSLKW0P' }, Title: { AmazonAPI: { en: 'LEGO 41597 Brick Headz Go Brick Me Building Set' } }, VendorPartNumber: '41597' }, createdAt: '2018-01-31T16:02:47+00:00', updatedAt: '2019-05-19T20:19:33+00:00', status: null, vendorPartNumber: '41597', eanCode: '5702016072624', id: '2e0d0714-06a0-11e8-84e4-f5036771bf95', categories: [ '00dde55c-6db9-11e9-8963-eff82f36df03', '026e984e-6db9-11e9-97cb-1739d4799a53', '028cd98a-6db9-11e9-bf68-11f5ff0b8ac8', '07ed63d6-6db9-11e9-a244-d92c0f02915d' ], favourite: false }, '9e607788-207d-11e9-bd0e-b1bad9e0b610': { attributes: { Category1: { Lekkerland: { en: 'Katja', fr: 'Katja', nl: 'Katja' } }, DeepLearning: { ToSaveDataTo: { nl: 'trein, spoorweglijn), vervoer, reizen, station, weg, voertuig, motor, openbaar, verkeer, buis (spoorweg), geen persoon, racebaan, platform, forens, auto, buitenshuis, snel, daglicht' } }, Description: { Lekkerland: { en: 'AARDBEISTICKS GEVULD ', fr: 'AARDBEISTICKS GEVULD ', nl: 'AARDBEISTICKS GEVULD ' } }, EAN: '8716100331648', ImageUrl: { ToSaveDataTo: 'https://cdn.londonandpartners.com/visit/london-organisations/transport-system/59590-640x360-overground-train_640.jpg' }, SKU: { Lekkerland: '111945' }, Title: { Lekkerland: { en: 'KATJA FASSIN B.V. ', fr: 'KATJA FASSIN B.V. ', nl: 'KATJA FASSIN B.V. ' } }, Weight: { Lekkerland: { en: '1.615', fr: '1.615', nl: '1.615' } } }, createdAt: '2019-01-25T08:45:51+00:00', updatedAt: '2019-05-16T09:54:46+00:00', status: null, vendorPartNumber: '8716100331648', eanCode: '8716100331648', id: '9e607788-207d-11e9-bd0e-b1bad9e0b610', categories: [ '00dde55c-6db9-11e9-8963-eff82f36df03' ], favourite: false } }; var myCopy = null;
Tests:
Lodash cloneDeep
myCopy = _.cloneDeep(MyObject);
Json clone
myCopy = JSON.parse(JSON.stringify(MyObject));
ramda
myCopy = R.clone(MyObject);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Lodash cloneDeep
Json clone
ramda
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!
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
It appears that you have provided some sample data and benchmark results, but I'll do my best to answer your question in a concise manner. Based on the provided data, it seems like we're dealing with benchmarking different methods for cloning or copying JavaScript objects. Specifically: 1. Lodash `cloneDeep` function 2. JSON.parse(JSON.stringify) method 3. Ramda's `R.clone` function The latest benchmark results show that: * Ramda's `clone` function is the fastest, with an average execution time of approximately 5374 ms per second. * JSON.parse(JSON.stringify) is slower, averaging around 6740 ms per second. * Lodash's `cloneDeep` is the slowest, averaging about 8847 ms per second. These results suggest that Ramda's `R.clone` function is the most efficient method for cloning JavaScript objects.
Related benchmarks:
Lodash benchmark (Anton)
Lodash cloneDeep vs JSON Clone with Array
cloneDeep vs JSON stringify + parse (long arr)
lodash cloneDeep vs json.stringify
Lodash cloneDeep vs JSON parse
Comments
Confirm delete:
Do you really want to delete benchmark?