1 /* eslint-disable no-unused-vars */
2 import deepClone from 'deep-clone'
3 import clone from 'just-clone'
5 import { clone as rambdaClone } from 'rambda'
6 import { bench, group, run } from 'tatami-ng'
8 import { generateRandomObject } from './benchmark-utils.mjs'
10 const object = generateRandomObject()
12 group(`Deep clone object with ${Object.keys(object).length} keys`, () => {
13 bench('JSON stringify/parse', (obj = object) => {
14 JSON.parse(JSON.stringify(obj))
16 bench('structuredClone', (obj = object) => {
19 bench('lodash cloneDeep', (obj = object) => {
22 bench('rambda clone', (obj = object) => {
25 bench('just-clone', (obj = object) => {
28 bench('deep-clone', (obj = object) => {