Skip to content

Conversation

clydin
Copy link
Member

@clydin clydin commented Nov 11, 2019

The node modules directory contains a massive set of directories and files. When watching via polling, that set needs to be queried repeatedly to determine if any files have changed. Changes within node modules are quite rare while using ng serve or ng build --watch. As a result, polling the node modules directory is rarely useful. This change causes CPU usage to drop from a potential high of ~80% to a more manageable ~5-10%.

This also fixes the flag option variant of --poll for ng serve so that it results in the default value of 500 ms instead of disabling polling. ng build --watch already contains a fix for this.

@clydin clydin added the target: patch This PR is targeted for the next patch release label Nov 11, 2019
The node modules directory contains a massive set of directories and files.  When watching via polling, that set needs to be queried repeatedly to determine if any files have changed.  Changes within node modules are quite rare while using `ng serve` or `ng build --watch`.  As a result, polling the node modules directory is rarely useful.  This change causes CPU usage to drop from a potential high of ~80% to a more manageable ~5-10%.
@mgechev mgechev merged commit d415223 into angular:master Nov 12, 2019
@clydin clydin deleted the fix-polling branch November 12, 2019 21:04
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants