[wp-trac] [WordPress Trac] #44241: Increase the interval used by grunt watch to reduce CPU usage

WordPress Trac noreply at wordpress.org
Sat May 26 22:17:45 UTC 2018


#44241: Increase the interval used by grunt watch to reduce CPU usage
------------------------------+------------------------------
 Reporter:  jeremyfelt        |       Owner:  (none)
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  Awaiting Review
Component:  Build/Test Tools  |     Version:
 Severity:  normal            |  Resolution:
 Keywords:  has-patch         |     Focuses:
------------------------------+------------------------------
Description changed by jeremyfelt:

Old description:

> `grunt watch` appears to use around 40% of my CPU when sitting idle. By
> default, [grunt-contrib-watch https://github.com/gruntjs/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.
>
> 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.

New description:

 `grunt watch` appears to use around 40% of my CPU when sitting idle. By
 default, [https://github.com/gruntjs/grunt-contrib-watch 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 [https://github.com/gruntjs/grunt-contrib-watch/issues/429 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.

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44241#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list