Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
const Benchmark = require('benny')
const { generateRandomInteger } = require('./benchmark-utils')
const _ = require('lodash')
+const clone = require('just-clone')
const size = generateRandomInteger(500)
const testObject = {}
Benchmark.add('lodash deep clone', (obj = testObject) => {
const objClone = _.cloneDeep(obj)
}),
+ Benchmark.add('just-clone', (obj = testObject) => {
+ const objClone = clone(obj)
+ }),
Benchmark.cycle(),
Benchmark.complete(),
Benchmark.save({
"license": "MIT",
"dependencies": {
"benny": "^3.7.1",
+ "just-clone": "^6.2.0",
"lodash": "^4.17.21",
"microtime": "^3.1.1",
"uuid": "^9.0.0"
"node": ">=4.0"
}
},
+ "node_modules/just-clone": {
+ "version": "6.2.0",
+ "resolved": "https://registry.npmjs.org/just-clone/-/just-clone-6.2.0.tgz",
+ "integrity": "sha512-1IynUYEc/HAwxhi3WDpIpxJbZpMCvvrrmZVqvj9EhpvbH8lls7HhdhiByjL7DkAaWlLIzpC0Xc/VPvy/UxLNjA=="
+ },
"node_modules/kleur": {
"version": "4.1.5",
"resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz",
"license": "MIT",
"dependencies": {
"benny": "^3.7.1",
+ "just-clone": "^6.2.0",
"lodash": "^4.17.21",
"microtime": "^3.1.1",
"uuid": "^9.0.0"