repositories
/
benchmarks-js.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
build(deps-dev): apply updates
[benchmarks-js.git]
/
deep-clone-object.js
diff --git
a/deep-clone-object.js
b/deep-clone-object.js
index e1d8b1c61fac3860a09cc13d145fd58a250b7c24..0f480c424263664a2e02ab3d8663a9bb87c65bf6 100644
(file)
--- a/
deep-clone-object.js
+++ b/
deep-clone-object.js
@@
-1,13
+1,13
@@
/* eslint-disable no-unused-vars */
const Benchmark = require('benny')
/* eslint-disable no-unused-vars */
const Benchmark = require('benny')
-const { generateRandomObject } = require('./benchmark-utils')
const _ = require('lodash')
const clone = require('just-clone')
const _ = require('lodash')
const clone = require('just-clone')
+const { generateRandomObject } = require('./benchmark-utils')
-const
{ object, size }
= generateRandomObject()
+const
object
= generateRandomObject()
Benchmark.suite(
Benchmark.suite(
- `Deep clone object with ${
size
} keys`,
+ `Deep clone object with ${
Object.keys(object).length
} keys`,
Benchmark.add('JSON stringify/parse', (obj = object) => {
const objClone = JSON.parse(JSON.stringify(obj))
}),
Benchmark.add('JSON stringify/parse', (obj = object) => {
const objClone = JSON.parse(JSON.stringify(obj))
}),
@@
-37,4
+37,6
@@
Benchmark.suite(
format: 'table.html',
details: true
})
format: 'table.html',
details: true
})
-)
+).catch(err => {
+ console.error(err)
+})