question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Slow performance and high CPU usage on ng serve and ng serve --aot

See original GitHub issue

When 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.

captura de pantalla 2018-07-31 a la s 09 53 26

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:closed
  • Created 5 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
jokecampcommented, Sep 14, 2018

I had the same issue with:

node 10.8.0 and npm 6.2.0 and OSX 10.13.6

I was able to temporarily resolve the CPU and node-gyp errors by running this in my local project:

npm install fsevents@1.2.3

1reaction
askdesignerscommented, Jun 13, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found