[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:15:22 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 | Keywords: has-patch
Focuses: |
------------------------------+-----------------------------
`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.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44241>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list