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

[WIP] perf: filter by ext on chokidar side #2111

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pahan35
Copy link

@pahan35 pahan35 commented Mar 28, 2023

I noticed that nodemon uses a lot of CPU while watching my current project.

I investigated it and found that it is chokidar who consumes lots of resources. I found this issue paulmillr/chokidar#1162.

I looked into the problem through the context of nodemon and found that chokidar watches all the files even if we are interested in files with specific extensions.

So, I made this change paulmillr/chokidar#1274 and proposed it to the chokidar.

If talking in numbers, before that change, I had watched 29 892 files and had usage of CPU. It started from the range 198 - 203 at the beginning and stoped at level 217 - 219 after 5-10 restarts. if retrieved via ps -C node -wwo pid,%cpu,%mem,cmd

After these changes, I started having 20 140 files watched and CPU usage at 173 - 181 at the beginning, which is a noticeable reduction for my system.

@remy and community, if you consider these changes to be a meaningful improvement, please help me get the PR paulmillr/chokidar#1274 merged.

Also, feel free to share your feedback if you see some improvements in the work I did.

Thanks in advance!

@netlify
Copy link

netlify bot commented Mar 28, 2023

Deploy Preview for nodemon ready!

Name Link
🔨 Latest commit 3485034
🔍 Latest deploy log https://app.netlify.com/sites/nodemon/deploys/64233527b32673000787622a
😎 Deploy Preview https://deploy-preview-2111--nodemon.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

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.

1 participant