#44241 closed defect (bug) (fixed)
Increase the interval used by grunt watch to reduce CPU usage
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | has-patch |
Focuses: | Cc: |
Description (last modified by )
grunt watch
appears to use around 40% of my CPU when sitting idle. By default, grunt-contrib-watch uses a 100ms interval. Several of the groups in our _watch
config specify an interval of 2 seconds, but others defer to the default.
In my local environment (non-VM), if I add options: { interval: 2000 }
to the config, colors, test, and phpunit groups, grunt watch
CPU usage stays consistently within 2 to 5% at idle.
See this related discussion on the grunt-contrib-watch project
If I change all configurations to 1 second, grunt watch
CPU usage stays at around 9%.
I'm attaching a patch that applies only the interval addition to each of the other groups.
Attachments (2)
Change History (6)
Note: See
TracTickets for help on using
tickets.
In 44241.2.diff I've moved
options: { interval: 2000 }
to the top-level option that applies to all the_watch
sub-tasks rather than adding it to each sub-task, all watch tasks will default to this 2s value.Locally my mid-2014 MacBook Pro sees CPU usage from
grunt watch
sit at ~4%