-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
grunt dev
has high CPU usage when idle
#9718
Comments
This appears to be due to how watchman is a good tool for very efficiently watching files and running tasks (as used by ember-cli) but I haven't found any grunt integration (although there is a gulp integration). Short-term a workaround may be to add a |
refs TryGhost#9718 - running `grunt dev --no-server-watch` will skip watching server and theme files - reduces idle CPU usage from 20% to 0% - useful for client-only development to save battery power
Today 26d567b was done, which is related to this. I think this issue needs prioritising. Every time I run |
closes TryGhost#9718 - fs.fileWatch that is used internally by 'gase' in 'grunt-contrib-watch', is having 100ms pooling default (https://github.com/shama/gaze/blob/07828a684566b6d4844f12b747e74e376fa31744/lib/gaze.js#L36). This is causing hight CPU usage for large amount of files. - As suggested in https://github.com/gruntjs/grunt-contrib-watch#why-is-the-watch-devouring-all-my-memorycpu the watch interval was set to higher 500ms because the recommended default of 5s (gruntjs/grunt-contrib-watch#145 (comment)) was visible in the development flow
In case the issue with high CPU usage resurfaces next optimization would be switching to proposed above watchman for file change tracking. Possible candidate for this - https://github.com/BuddyBuild/bb-grunt-watch |
Issue Summary
grunt dev
consistently uses around 20% CPU (as measured by Activity Monitor) when idle without a Ghost restart or Ember rebuild happening.This isn't particularly noticeable unless developing whilst on battery power.
To Reproduce
grunt dev
grunt
task in Activity MonitorThe same CPU usage is evident when running
grunt dev --server
which doesn't start a background ember process.Commenting out the express watcher drops idle CPU usage to 0.5% or less.
Technical details:
The text was updated successfully, but these errors were encountered: