Add just-clone to cloning benchmark
[benchmarks-js.git] / clone-object.js
index 671e8c075e5c9bfd6793f5b9be5d231dd8c054d4..73619f246e7fa90e1689a7eae6aa366ed44e8f2b 100644 (file)
@@ -2,6 +2,7 @@
 const Benchmark = require('benny')
 const { generateRandomInteger } = require('./benchmark-utils')
 const _ = require('lodash')
+const clone = require('just-clone')
 
 const size = generateRandomInteger(500)
 const testObject = {}
@@ -29,6 +30,9 @@ Benchmark.suite(
   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({