repositories
/
benchmarks-js.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge dependabot/npm_and_yarn/neostandard-0.9.0 into combined-prs-branch
[benchmarks-js.git]
/
deep-clone-object.mjs
diff --git
a/deep-clone-object.mjs
b/deep-clone-object.mjs
index 6796eaddea9daa702163f1f2fa5681f794d8e79d..eda04d0d83e47d52ae7d6340dc8940bbf69bb5c9 100644
(file)
--- a/
deep-clone-object.mjs
+++ b/
deep-clone-object.mjs
@@
-1,9
+1,8
@@
-/* eslint-disable no-unused-vars */
import deepClone from 'deep-clone'
import clone from 'just-clone'
import _ from 'lodash'
import deepClone from 'deep-clone'
import clone from 'just-clone'
import _ from 'lodash'
-import { bench, group, run } from 'mitata'
import { clone as rambdaClone } from 'rambda'
import { clone as rambdaClone } from 'rambda'
+import { bench, group, run } from 'tatami-ng'
import { generateRandomObject } from './benchmark-utils.mjs'
import { generateRandomObject } from './benchmark-utils.mjs'
@@
-11,25
+10,25
@@
const object = generateRandomObject()
group(`Deep clone object with ${Object.keys(object).length} keys`, () => {
bench('JSON stringify/parse', (obj = object) => {
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) => {
})
bench('structuredClone', (obj = object) => {
-
const objCloned =
structuredClone(obj)
+ structuredClone(obj)
})
bench('lodash cloneDeep', (obj = object) => {
})
bench('lodash cloneDeep', (obj = object) => {
-
const objCloned =
_.cloneDeep(obj)
+ _.cloneDeep(obj)
})
bench('rambda clone', (obj = object) => {
})
bench('rambda clone', (obj = object) => {
-
const objCloned =
rambdaClone(obj)
+ rambdaClone(obj)
})
bench('just-clone', (obj = object) => {
})
bench('just-clone', (obj = object) => {
- c
onst objCloned = c
lone(obj)
+ clone(obj)
})
bench('deep-clone', (obj = object) => {
})
bench('deep-clone', (obj = object) => {
-
const objCloned =
deepClone(obj)
+ deepClone(obj)
})
})
await run({
})
})
await run({
- units: true
+ units: true
,
})
})