X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=deep-clone-object.mjs;h=40b508da1505dd0b43984de6c62bff34f5b1442f;hb=HEAD;hp=00753e2f439ed0df4c3d7c0250cdf4f687cd2606;hpb=4676a95cabbad0975a245e72e822467868f95ac8;p=benchmarks-js.git diff --git a/deep-clone-object.mjs b/deep-clone-object.mjs index 00753e2..eda04d0 100644 --- a/deep-clone-object.mjs +++ b/deep-clone-object.mjs @@ -1,4 +1,3 @@ -/* eslint-disable no-unused-vars */ import deepClone from 'deep-clone' import clone from 'just-clone' import _ from 'lodash' @@ -11,25 +10,25 @@ const object = generateRandomObject() group(`Deep clone object with ${Object.keys(object).length} keys`, () => { bench('JSON stringify/parse', (obj = object) => { - const objCloned = JSON.parse(JSON.stringify(obj)) + JSON.parse(JSON.stringify(obj)) }) bench('structuredClone', (obj = object) => { - const objCloned = structuredClone(obj) + structuredClone(obj) }) bench('lodash cloneDeep', (obj = object) => { - const objCloned = _.cloneDeep(obj) + _.cloneDeep(obj) }) bench('rambda clone', (obj = object) => { - const objCloned = rambdaClone(obj) + rambdaClone(obj) }) bench('just-clone', (obj = object) => { - const objCloned = clone(obj) + clone(obj) }) bench('deep-clone', (obj = object) => { - const objCloned = deepClone(obj) + deepClone(obj) }) }) await run({ - units: true + units: true, })