High CPU usage from make dev
due to Gulp (?) using inefficient file watching
#5567
Labels
make dev
due to Gulp (?) using inefficient file watching
#5567
The
gulp watch
tasks across our various frontend projects have high CPU usage while idle. Using wtfnode I tracked this down to instances ofStatWatcher
which is Node's polling-based file watcher, created byfs.watchFile
API calls.By monkey-patching
fs.watchFile
at the start ofnode_modules/.bin/gulp
to log its arguments withconsole.trace
, we can see that a lot of polling-based watchers with super-short intervals are being registered:The text was updated successfully, but these errors were encountered: