Skip to content

Commit

Permalink
bench: add tiny-glob to glob benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodrr committed May 21, 2021
1 parent 3419f61 commit 3b1b707
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
10 changes: 9 additions & 1 deletion benchmarks/glob-benchmark.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const { fdir } = require("fdir5");
const glob = require("glob");
const fg = require("fast-glob");
const tg = require("tiny-glob");
const tgSync = require("tiny-glob/sync");
const b = require("benny");
const packageJson = require("../package.json");
const exportToHTML = require("./export");
Expand All @@ -27,7 +29,10 @@ async function benchmark() {
});
}),
b.add("fast-glob async", async () => {
await fg("**.js", { dot: true });
await fg("**.js", { dot: true, onlyFiles: true });
}),
b.add("tiny-glob async", async () => {
await tg("**/**.js", { dot: true, filesOnly: true });
}),
b.cycle(),
b.complete()
Expand All @@ -47,6 +52,9 @@ async function benchmark() {
b.add("fast-glob sync", () => {
fg.sync("**.js", { dot: true });
}),
b.add("tiny-glob sync", () => {
tgSync("**/**.js", { dot: true });
}),
b.cycle(),
b.complete()
);
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"recursive-readdir": "^2.2.2",
"rrdir": "^6.1.2",
"systeminformation": "^5.3.1",
"tiny-glob": "^0.2.9",
"walk-sync": "^2.0.2"
}
}
18 changes: 18 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,16 @@ glob@^7.1.6:
once "^1.3.0"
path-is-absolute "^1.0.0"

[email protected]:
version "0.1.0"
resolved "https://registry.yarnpkg.com/globalyzer/-/globalyzer-0.1.0.tgz#cb76da79555669a1519d5a8edf093afaa0bf1465"
integrity sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==

globrex@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/globrex/-/globrex-0.1.2.tgz#dd5d9ec826232730cd6793a5e33a9302985e6098"
integrity sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==

graceful-fs@^4.1.11, graceful-fs@^4.1.6, graceful-fs@^4.2.0:
version "4.2.3"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423"
Expand Down Expand Up @@ -508,6 +518,14 @@ systeminformation@^5.3.1:
resolved "https://registry.yarnpkg.com/systeminformation/-/systeminformation-5.6.4.tgz#5f32fcb05a5849e2a0e71b182c1f56ce32219310"
integrity sha512-b2tvW1R+qjNEoAGgh734EGLgqbDMghjsHRaWo36skAC6JM1tw1pitcGz/REt+qSIRSXbE4PKECojhaSrBRrEmw==

tiny-glob@^0.2.9:
version "0.2.9"
resolved "https://registry.yarnpkg.com/tiny-glob/-/tiny-glob-0.2.9.tgz#2212d441ac17928033b110f8b3640683129d31e2"
integrity sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==
dependencies:
globalyzer "0.1.0"
globrex "^0.1.2"

to-regex-range@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4"
Expand Down

0 comments on commit 3b1b707

Please sign in to comment.