Skip to content

Commit

Permalink
feat(benchmark): add defu to compare with (#486)
Browse files Browse the repository at this point in the history
  • Loading branch information
xeho91 authored Jul 20, 2024
1 parent 305fcd9 commit 93599b4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"dependencies": {
"deepmerge": "^4.3.1",
"deepmerge-ts": "link:..",
"defu": "^6.1.4",
"lodash": "^4.17.21",
"merge-anything": "^5.1.7",
"object-accumulator": "^0.0.5"
Expand Down
8 changes: 8 additions & 0 deletions benchmark/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions benchmark/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { fileURLToPath } from "node:url";

import deepmerge from "deepmerge";
import { deepmerge as deepmergeTs } from "deepmerge-ts";
import { defu } from "defu";
import lodash from "lodash";
import { merge as mergeAnything } from "merge-anything";
import { Accumulator as ObjectAccumulator } from "object-accumulator";
Expand Down Expand Up @@ -74,6 +75,9 @@ for (let m_i = 0; m_i < benchmarkDataSets.length; m_i++) {
.add("deepmerge", () => {
deepmerge.all(benchmarkData);
})
.add("defu", () => {
defu({}, ...benchmarkData);
})
.add("merge-anything", () => {
(mergeAnything as any)(...benchmarkData);
})
Expand Down
1 change: 1 addition & 0 deletions project-dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ deassert
deepmerge
deepmergecustomoptions
deepmergets
defu
denoify
foo
fred
Expand Down

0 comments on commit 93599b4

Please sign in to comment.