Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
lodash _.cloneDeep() vs deppClone()
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Browser:
Chrome 142
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
9 months ago
own
86K/s
lodash
6K/s
View exact numbers
Test name
Executions per second
✓
own
85,838 Ops/sec
lodash
5,874 Ops/sec
HTML Preparation code:
<script src='https://cdn.jsdelivr.net/npm/lodash@4.17.10/lodash.min.js'></script>
Script Preparation code:
class Foo { } function objectCopy(object) { if (!object) { return {}; } const copyObject = {}; for (const attribute in object) { if (Array.isArray(object[attribute])) { copyObject[attribute] = arrayCopy(object[attribute]); continue; } if (object[attribute] instanceof Object) { copyObject[attribute] = objectCopy(object[attribute]); continue; } copyObject[attribute] = object[attribute]; } return copyObject; } function arrayCopy(array) { if (!array) { return []; } const copyArray = []; for (let i = 0; i < array.length; i++) { if (Array.isArray(array[i])) { copyArray[i] = arrayCopy(array[i]); continue; } if (array[i] instanceof Object) { copyArray[i] = objectCopy(array[i]); continue; } copyArray[i] = array[i]; } return copyArray; } var user = { name: "Teszt Elek", address: { country: "Magyarország", county: "Borsod-Abaúj-Zemplém megye", city: "Miskolc", street: "Felsőruzsin", streetType: "körút", houseNumber: "21" }, job: { professional: "Szoftverfejleszto", company: { name: "Evosoft Hungary Kft.", group: { department: { name: "O5", code: "O5", teams: [ "1", "2", "3", "4" ], }, team: { name: "4", members: [ "Gipsz Jakab", "Teszt Elek", "John Doe", "Jane Doe", "Gipsz Jakab", "Teszt Elek", "John Doe", "Jane Doe", "Gipsz Jakab", "Teszt Elek", "John Doe", "Jane Doe", "Gipsz Jakab", "Teszt Elek", "John Doe", "Jane Doe", "Gipsz Jakab", "Teszt Elek", "John Doe", "Jane Doe" ], responibilityFor: { share: { file: "//Something.dat", binary: [ [2], [3], [5], [55], [1623], [1], [0], [1024], [2], [3], [5], [55], [1623], [1], [0], [1024], [2], [3], [5], [55], [1623], [1], [0], [1024] ], data: { binary: [ [2], [3], [5], [55], [1623], [1], [0], [1024], [2], [3], [5], [55], [1623], [1], [0], [1024], [2], [3], [5], [55], [1623], [1], [0], [1024] ], obj: { vami: "vami", hami: "hami", dami: { ini: "ini", ani: { ani: "ani" } } } } } } } } } } }
Tests:
lodash
_.cloneDeep(user)
own
objectCopy(user)