-
-
Notifications
You must be signed in to change notification settings - Fork 130
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
Improve performance #50
Comments
FWIW, the biggest performance bottleneck in my testing on eleventy (for whatever reason) was the (Love globby—thanks!) |
About filtering out |
I'm adding this here as it's somewhat related: right now just requiring I've switched to tiny-glob in a project of mine, which takes less than 10ms to require on my system and install less than 100kb of stuff. Perhaps some heavy dependencies could be removed/replaced. |
I think so, yes. |
Yeah, that is quite unfortunate. It's because of // @mrmlnc |
I concur with @zachleat that the On our codebase:
~8000% difference is a lot... |
rollup is said to be good at removing dead code, I don't know if it goes as far as to repackage packages. |
Just ran into this as well in our codebase. Commenting out gitignore leads to an improvement from 500 sec to 2 sec. |
While their use is at this point somewhat dubious (due to performance issues), that's not a reason we should stop people from using them. Reference: sindresorhus/globby#50
For folks complaining about the performance hit of the Some of this additional work is unnecessary in some conditions, but I don't know offhand how difficult it is to determine that at runtime given the recursive nature of Reference: |
FYI, this is not an apples-to-apples comparison as the |
For scenarios where only the root |
By coincidence I have recently written a little benchmark comparing globby against Basically as mentioned in the original post indeed skipping ignored directories as early as possible is significant. Additionally a much faster implementation than |
@fabiospampinato Nice! I was just in the process of writing my own ideal glob function—based on But just have a couple of questions:
|
@danielbayley could you open an issue about that in the other repo? That seems unrelated to |
@fabiospampinato Fair point. Sure, see fabiospampinato/tiny-readdir#2 and fabiospampinato/tiny-readdir-glob#2. |
I our case enabling |
This issue is dedicated to gathering ideas on how we can improve performance.
Some things that might help is to do filtering in the correct order to ensure minimal work is done, and cache and memoize as much as possible. The most important thing is that we skip ignored directories like
node_modules
as early as possible. It's the source of a lot of performance problems. The hard drive is the bottleneck, so we should ensure we interact with it as little as possible.Some more ideas in #44 and mrmlnc/fast-glob#15
This Node.js feature request would also help a lot: nodejs/node#15699
The text was updated successfully, but these errors were encountered: