Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(utils): add benchmarks for file system walk and glob libs #514

Merged
merged 2 commits into from
Feb 19, 2024

Conversation

BioPhoton
Copy link
Collaborator

@BioPhoton BioPhoton commented Feb 17, 2024

This PR includes perf benchmarks for:


file system crawling

> nx run utils:perf crawl-file-system

You can adjust the test with the following arguments:
directory      target directory of test      --directory=/Users/michael_hladky/WebstormProjects/quality-metrics-cli/node_modules
pattern        pattern to search             --pattern=/.json$/
 
Start benchmark...
 
Base x 2.43 ops/sec ±1.45% (17 runs sampled)
nodelib.fsWalk x 17.09 ops/sec ±0.74% (82 runs sampled)
 
Total Duration: 13.08 sec
Fastest is nodelib.fsWalk

glob search libs

> nx run utils:perf glob

You can adjust the test with the following arguments:
pattern      glob pattern of test      --pattern=/Users/michael_hladky/WebstormProjects/quality-metrics-cli/node_modules/**/*.js
 
Start benchmark...
 
glob found 27167 files
glob x 11.66 ops/sec ±19.61% (67 runs sampled)
globby found 27164 files
globby x 9.18 ops/sec ±0.74% (48 runs sampled)
fastGlob found 27164 files
fastGlob x 12.62 ops/sec ±0.76% (63 runs sampled)
 
Total Duration: 18.21 sec
Fastest is fastGlob

@BioPhoton BioPhoton marked this pull request as ready for review February 17, 2024 20:53
Copy link
Collaborator

@matejchalk matejchalk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, so fast-glob is correctly named 😁

package.json Outdated Show resolved Hide resolved
@BioPhoton BioPhoton merged commit 50e5f96 into main Feb 19, 2024
18 checks passed
@BioPhoton BioPhoton deleted the benchmark-file-crawler branch February 19, 2024 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants