angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Compile times hit 30 seconds or higher for simple changes when using ng serve

Open chrillewoodz opened this issue 9 years ago • 24 comments

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

angular-cli: 1.0.0 node: 6.9.2 os: darwin x64 @angular/animations: 4.0.0 @angular/common: 4.0.0 @angular/compiler: 4.0.0 @angular/core: 4.0.0 @angular/forms: 4.0.0 @angular/http: 4.0.0 @angular/platform-browser: 4.0.0 @angular/platform-browser-dynamic: 4.0.0 @angular/router: 4.0.0 @angular/cli: 1.0.0 @angular/compiler-cli: 4.0.0

Repro steps.

I've not been able to pinpoint this exactly but it seems as if the issue comes whenever changing things in the shared folder.

My folder structure looks like this (starting in /app):

- routes
- shared
  - animations
  - components
  - directives
  - constants
  - interfaces
  - guards
  - services
  - validators
  - pipes
  - modules
    - components.module.ts // Imports and exports all components in the components folder
    - shared.module.ts // Imports and exports all pipes and directives as well as the necessary angular modules that each page module will need in order to work

When changes things in the routes folder the compile does not take as long, but it can still be between 5-15 seconds. When changing something in the components folder for example, I need to sit and wait for at least 20 seconds, even for small changes such as changing a number from a 0 to a 1. Which is just ridiculous.

Desired functionality.

I'm expecting compile times to not be above 10 seconds, regardless of the size of the change.

Mention any other details that might be useful.

I didn't notice this change in the 1.0.0-beta.26 version which I was using earlier with the exact same structure. This began when I switched over to angular 4 and the non-beta version of the CLI (1.0.0). I can't provide a repo unfortunately since the code is not open source, but hopefully this is enough in order to investigate.

Each folder in the shared folder can have quite a lot of files in them. components and interfaces are especially large since they can have nested folders about 3-4 levels deep. Right now the components folder have about 20 components in it and the more I add the more it seems to slow down.

If you require further information just ask, I would really love for this one to get solved as quickly as possible.

chrillewoodz avatar May 28 '17 11:05 chrillewoodz

Much has improved since CLI 1.0. The performance has been greatly improved overall (with more to come). If anyone is still observing issues, please open a new issue describing the problem.

clydin avatar Jan 05 '18 20:01 clydin

Hello, I am using v 1.7.0 and still having the same issue. It takes about 35 sec for me.

Son-Lam avatar Mar 08 '18 23:03 Son-Lam

You can use this flag while compiling: ng serve --source-map=false

It take 10sec to compile now while previously it was taking 32sec. source-map is just used for debugging. So if not using debugger you can disable and compile. And while recompiling it will take lesser time I think so.

anothershubham avatar Jun 22 '18 10:06 anothershubham

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.