repositories
/
benchmarks-js.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into combined-prs-branch
[benchmarks-js.git]
/
shallow-clone-object.mjs
diff --git
a/shallow-clone-object.mjs
b/shallow-clone-object.mjs
index e01a3c4f61f454b17a575dce06a1620ff6a7ab47..70b14d98a6c25dc5860d5eba4e36b4f1ccd8765d 100644
(file)
--- a/
shallow-clone-object.mjs
+++ b/
shallow-clone-object.mjs
@@
-1,4
+1,3
@@
-/* eslint-disable no-unused-vars */
import _ from 'lodash'
import { assoc } from 'rambda'
import { bench, group, run } from 'tatami-ng'
import _ from 'lodash'
import { assoc } from 'rambda'
import { bench, group, run } from 'tatami-ng'
@@
-9,19
+8,19
@@
const object = generateRandomObject()
group(`Shallow clone object with ${Object.keys(object).length} keys`, () => {
bench('Spread', () => {
group(`Shallow clone object with ${Object.keys(object).length} keys`, () => {
bench('Spread', () => {
-
const objClone =
{ ...object }
+
return
{ ...object }
})
bench('Object assign', () => {
})
bench('Object assign', () => {
-
const objClone =
Object.assign({}, object)
+
return
Object.assign({}, object)
})
bench('lodash clone', () => {
})
bench('lodash clone', () => {
-
const objClone =
_.clone(object)
+ _.clone(object)
})
bench('rambda assoc', () => {
})
bench('rambda assoc', () => {
-
const objClone =
assoc(object)
+ assoc(object)
})
})
await run({
})
})
await run({
- units: true
+ units: true
,
})
})