Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Clone wars: lodash vs klona vs structuredClone
(version: 1)
Comparing performance of: Native structuredClone vs Klona vs Lodash
Comparing performance of:
Native structuredClone vs Klona vs Lodash.cloneDeep
Created:
one year ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<script src='https://unpkg.com/klona@2.0.6/json/index.min.js'></script> <script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/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, jayson: { stringify: 'JSON.stringify() method converts a JavaScript value to a JSON string....', parse: 'JSON.parse() method parses a JSON string...' }, array: [ 1, 2, 3, { one: [2, 3, 4] } ] }; var myCopy = null;
Tests:
Native structuredClone
myCopy = structuredClone(MyObject);
Klona
myCopy = klona.klona(MyObject);
Lodash.cloneDeep
myCopy = _.cloneDeep(MyObject);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Native structuredClone
Klona
Lodash.cloneDeep
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
6 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36
Browser/OS:
Chrome 141 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Native structuredClone
567000.5 Ops/sec
Klona
4001736.5 Ops/sec
Lodash.cloneDeep
802814.4 Ops/sec
Related benchmarks:
Lodash cloneDeep vs JSON Clone (with array)
Lodash cloneDeep vs JSON Clone (with array & immer)
Lodash cloneDeep vs JSON Clone vs structuredClone
Lodash cloneDeep vs structuredClone vs JSON Parse
Lodash cloneDeep vs structuredClone vs JSON clone s
Lodash cloneDeep vs JSON stringify vs structuredClone
Lodash (4.17.11) cloneDeep vs JSON Clone vs structuredClone
Lodash cloneDeep vs structuredClone vs Json.stringify
lodash cloneDeep vs. JSON.parse(JSON.stringify()) vs. structuredClone
Comments
Confirm delete:
Do you really want to delete benchmark?