Slow performance and high CPU usage on ng serve and ng serve --aot
See original GitHub issueWhen run “ng serve” or “ng serve --aot” CPU usage is upper 100% and performance is so bad.
Recompiling take about 3 minutes on reload page.

environment
Angular CLI: 6.1.1
Node: 10.7.0
OS: darwin x64
Angular: 6.1.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.6.8
@angular-devkit/build-angular 0.6.8
@angular-devkit/build-optimizer 0.6.8
@angular-devkit/core 0.6.8
@angular-devkit/schematics 0.7.1
@angular/cli 6.1.1
@ngtools/webpack 6.0.8
@schematics/angular 0.7.1
@schematics/update 0.7.1
rxjs 6.2.2
typescript 2.7.2
webpack 4.8.3
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Angular CLI - ng serve - high cpu usage from node process
In Angular development context; transpilation/compilation causes CPU spike. When this happens too frequent, your system is in trouble.
Read more >High Cpu Usage On First Load Of Angular Application - ADocLib
I have windows 10 and the moment I run ng serve open to run Angular app the VS Code suddenly works slow Visual...
Read more >Performance Optimization Techniques in Angular - XenonStack
How Angular compiles and its performance? The application can be compiled using two following commands:- ng-serve; ng-build. The ng-serve ...
Read more >Angular workspace configuration
Configures defaults for creating a Universal application with server-side rendering, using the ng run <project>:server command. architect/app-shell, Configures ...
Read more >Why is Angular so slow? - Quora
Noob frustration. 1. In development mode when you run Angular using the command “ng serve” you get a feeling that it is taking...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I had the same issue with:
node
10.8.0
and npm6.2.0
and OSX 10.13.6I was able to temporarily resolve the CPU and node-gyp errors by running this in my local project:
npm install fsevents@1.2.3
I find it remarkable that the Angular build process is so crap. I regularly have to run a prod build twice on our 4gb mem server as it completely hoses the CPU and memory. A vue or react build of similar size takes 1/5 of the resources.