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: use fast-glob instead of globby #5606

Merged
merged 3 commits into from
Jul 26, 2023
Merged

Conversation

paul-soporan
Copy link
Member

@paul-soporan paul-soporan commented Jul 25, 2023

What's the problem this PR addresses?

globby is built on top of fast-glob (which we already use in @yarnpkg/shell), but the only useful feature it adds for us is expandDirectories which has been broken for 3 years so we can't use it anyways.

In addition, globby is maintained by a person that handles reasonable criticism by blocking our lead maintainer on both Twitter and GitHub, which makes it harder than necessary to communicate ¯\(ツ)/¯.

How did you fix it?

Replaced globby with fast-glob.

Bundle size:

  • Before: 2730152 bytes
  • After: 2720218 bytes
  • Improvement: 0.36%

Benchmarks:

  • Before:
Benchmark 1: YARN_IGNORE_PATH=1 node packages/yarnpkg-cli/bundles/yarn.js run
  Time (mean ± σ):     293.0 ms ±   4.2 ms    [User: 387.2 ms, System: 91.8 ms]
  Range (min … max):   285.8 ms … 299.5 ms    10 runs
  • After:
Benchmark 1: YARN_IGNORE_PATH=1 node packages/yarnpkg-cli/bundles/yarn.js run
  Time (mean ± σ):     291.9 ms ±   2.4 ms    [User: 387.6 ms, System: 87.7 ms]
  Range (min … max):   286.6 ms … 294.3 ms    10 runs  

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@paul-soporan paul-soporan changed the title refactor: use fast-glob instead of globby perf: use fast-glob instead of globby Jul 25, 2023
@paul-soporan paul-soporan added this pull request to the merge queue Jul 26, 2023
Merged via the queue into master with commit b3acb59 Jul 26, 2023
15 checks passed
@paul-soporan paul-soporan deleted the paul/refactor/use-fast-glob branch July 26, 2023 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants