-
Notifications
You must be signed in to change notification settings - Fork 273
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
File watching optimization #1269
Comments
Here are some options which came to my mind:
|
Thanks a lot for filing the issue @matuszeman. I've done a little bit of exploration on the matter. We can technically introduce an optimization when If you specify exclude filters, there's still really no way for us to avoid watching the whole project root, because the list of directories to watch can always change, so we couldn't be aware of new directories if they're not already under the watched directories when we start the Garden process. So I think your first suggested option is the only viable one to solve your issue (unless I'm missing a better idea, which I won't rule out :P). By default I resist adding config options, but I don't really see a way around it here, since the include/exclude filters can't sufficiently inform us what to watch except in very specific cases. @matuszeman would you like to have a go at implementing a |
@edvald I played with it yesterday a bit, it's not tested at all, I don't even know if this approach helps the problem. I'd need to run it on the project I had a issue with before. Have a look. I wanted to stay consistent with other |
This basically relies on optimizations already implemented in chokidar, the library we use for file watching. Hopefully this can solve the excessive CPU/RAM usage some users have reported. Closes #1269
This basically relies on optimizations already implemented in chokidar, the library we use for file watching. Hopefully this can solve the excessive CPU/RAM usage some users have reported. Closes #1269
* fix(watcher): use exclude options to optimize file watching This basically relies on optimizations already implemented in chokidar, the library we use for file watching. Hopefully this can solve the excessive CPU/RAM usage some users have reported. Closes #1269
Garden seems to watch all files under project folder (ref: garden.ts#L287) which are then filtered out depending on e.g. module settings (ref: watch.ts#L172). This causes an issue with larger projects and the process runs out of memory after a while.
Could we discuss best way how this could be optimized please?
The text was updated successfully, but these errors were encountered: