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

refactor: switch from fast-glob to tinyglobby #791

Closed
wants to merge 1 commit into from

Conversation

benmccann
Copy link
Contributor

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

Ref #788

Breaking Changes

None

Additional Info

Copy link

codecov bot commented Dec 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.48%. Comparing base (a20dedd) to head (37253e3).
Report is 15 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #791      +/-   ##
==========================================
+ Coverage   90.55%   91.48%   +0.92%     
==========================================
  Files           2        2              
  Lines         413      411       -2     
  Branches      120      119       -1     
==========================================
+ Hits          374      376       +2     
+ Misses         38       34       -4     
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

You look good, have you tried to measure their performance?

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

I did some checks and got:

fast-glob x 15.46 ops/sec ±7.09% (47 runs sampled)
tinyglobby x 13.85 ops/sec ±4.45% (69 runs sampled)
Fastest is fast-glob

It seems that using it may cause performance issues.

@benmccann
Copy link
Contributor Author

@alexander-akait can you share the benchmark you ran?

The only thing I'm switching here at the moment is which escapePath method is used. Is that the method you benchmarked? tinyglobby's implementation is extremely simple as all it does is a regex replacement:
https://github.com/SuperchupuDev/tinyglobby/blob/d51e2b98d18486a904193e100e22a9c9ed8cbb08/src/utils.ts#L31

I would think that this method should be able to be run many orders of magnitude faster than that and any performance difference would just be noise in the overall performance of copy-web-plugin as this is such an infinitesimally small portion of the overall work that the plugin is doing

@alexander-akait
Copy link
Member

@benmccann Oh, I see, I just compared the speed of work between tinyglobby and fast-glob, as I understand it, this pr is not finished yet?

@benmccann
Copy link
Contributor Author

I thought I would break up the work to make things more reviewable and lower risk. This PR switches out all usage of fast-glob for tinyglobby, which I think we could merge here and then I could follow up with another PR to switch out globby for tinyglobby as well. If you're really worried about performance I could wait until the next tinyglobby release to do the second half as they're currently working to make sure tinyglobby is always faster than alternatives in SuperchupuDev/tinyglobby#76

@alexander-akait
Copy link
Member

@benmccann let's put all in one pr place, I don't think there will be many of them

@benmccann
Copy link
Contributor Author

Okay. I'll close this for the time being then

@benmccann benmccann closed this Dec 5, 2024
@alexander-akait
Copy link
Member

@benmccann We can keep open, no problems

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