Repository navigation
v7.0.0 bugs and 4/5x slower serve & compile AOT #12646
Description
I hesitate to open this issue on angular page. I opened same issue title 2 week ago here without AOT : v7.rc.0 serving 2x - 3x slower than stable versions on my projects after moving to angular 7.0.0 all is slower (jit seems OK)
I'm submitting a...
[ x ] Performance issue
[ x ] Bugs
Current behavior
All was OK with cli7rc3 and angular 6.1.10
This morning after updating to angular 7.0.0 serving with JIT is ok but serving with AOT or build my application or generating i18n xmb file is 2-3 times slower
Expected behavior
Get build/extract i18n time like with cli7rc3 and angular 6.1.10
1. Minimal info of AOT serving
- My project have >1200 files.
- Before update
node --max-old-space-size=8192 ./node_modules/@angular/cli/bin/ng serve --aot --sourceMap=false --disableHostCheck --port=4200first build finish in 45seconds and Now blocking:
3mn =>
11% building modules 9/10 modules 1 active ...ojects\i10\src\assets\styles\styles.cssand rest steps seems ok It finish in 228737ms
- Before update refresh(file edit) it finish in 30seconds and 3th refresh in 25seconds and Now it refresh in 200277ms and 3th refresh in WARNING : 381979ms it is >6 minutes
2. Minimal info of extract i18n
- Extract is 3-4 times slower than before update
Here is my angular.json config file
I tried debug with ndb and share my profile data with ng s --aot but it seems not work ndb crash ( disk is highly used...):

Environment
Angular CLI: 7.0.1
Node: 10.12.0
OS: win32 x64
Angular: 7.0.0
... common, compiler, compiler-cli, core, forms, http
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.10.1
@angular-devkit/build-angular 0.9.0-rc.3
@angular-devkit/build-optimizer 0.9.0-rc.3
@angular-devkit/build-webpack 0.9.0-rc.3
@angular-devkit/core 7.0.1
@angular-devkit/schematics 7.0.1
@angular/cdk 6.4.7
@angular/cli 7.0.1
@angular/material 6.4.7
@ngtools/webpack 7.0.0-rc.3
@schematics/angular 7.0.1
@schematics/update 0.10.1
rxjs 6.3.3
typescript 3.1.3
webpack 4.19.1
Others:
maybe related to : angular/angular#26572 , #12645
@filipesilva heya, sorry to make noise again if you consider this as angular compiler problem(as I think) close or move it please
Activity
filipesilva commentedon Oct 19, 2018
@istiti did the size of you main bundle increase as well after the update? I've read a report that the angular compiler was being included in bundles which can cause longer builds (this is unintended).
Also cc @ocombe about the i18n error.
filipesilva commentedon Oct 19, 2018
@istiti can you try
@@angular-devkit/build-angular@~0.10.0and tell me if the AOT rebuild times are still very long?88 remaining items
fxck commentedon Nov 28, 2018
Ever since updating to
serve/jit rebuild times got like ten times slower..
(running it with
"start:jit": "node --max_old_space_size=16384 ./node_modules/@angular/cli/bin/ng serve")jtyagi commentedon Nov 28, 2018
@filipesilva getting ERROR in Internal Error: The structure of the program changed during codegen..
while creating build using ng build --prod. it is working fine for ng build or ng serve.
while upgrading my application to angular 7.
"@angular/cli": "^7.1.0",
"@angular/compiler-cli": "~7.1.0"
"@angular/core": "~7.1.0"
angular.json configuration
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": false,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
}
titov-dmytro commentedon Nov 28, 2018
Same here
HarelM commentedon Dec 2, 2018
Just upgraded from 6.0 to 7.1 and build times of both production and incremental became unreasonable.
I have opened a separate issue here: #13112 which contains all the relevant data.
It seems that I'm now also getting javascript heap as described here: #5618.
Can be seen in latest appveyor build:
https://ci.appveyor.com/project/IsraelHikingHost/site
Should I downgrade back to 6? Does anyone in this thread have an experience with a version that is working as expected?
no-more commentedon Dec 2, 2018
Is it not possible to enable cache like cache-loader? Maybe it have already been asked and answered but when I was using webpack + ts-loader + cache-loader + thread-loader I was able to reduce my build time by 3-4 and rebuild time by almost 10. Watch was also greatly improved.
I had to switch to angular-cli to benefit AOT witch is not an option (JIT was taking over 30s on an high end computer).
I really like angular cli and schematics. But build, rebuild and watch times get me crazy.
If it was possible to improve build time with webpack it should be possible to do so with angular-cli, no ?
Thanks
parliament718 commentedon Dec 16, 2018
@HarelM cli v 7.1 was unbearably slow for me. Reverting to 6.2.8 gave me a drastic improvement
aalbericio commentedon Dec 17, 2018
I'd like to ask a little question regarding the future...
What is the expected impact of Webpack 5 in this issue? Is there any numbers Google can share on this?
Thanks
matheusdavidson commentedon Dec 24, 2018
Also have slower live reloading with angular 7. Was way quicker with angular 6.
Meligy commentedon Dec 25, 2018
Has anyone checked if the situation is different with Bazel running the compilation?
As explained by @mgechev in his post Introducing Bazel Schematics for Angular CLI.
filipesilva commentedon Dec 27, 2018
Just wanted to mention there was a regression in 7.1 (#13102), and we have a fix on the way for it.
StuartMc77 commentedon Jan 16, 2019
Has anyone got a definite fix for this yet? I created a new Angular 7 project (version details below) and running any ng commands while in the app folder is taking a ridiculous about of time, for example, running "ng --version" outside the app folder takes about 5 seconds, running it INSIDE the app folder took around 10 minutes.
VERSION DETAILS (ng --version):
Angular CLI: 7.2.1
Node: 8.11.3
OS: win32 x64
Angular: 7.2.0
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
@angular-devkit/architect 0.12.1
@angular-devkit/build-angular 0.12.1
@angular-devkit/build-optimizer 0.12.1
@angular-devkit/build-webpack 0.12.1
@angular-devkit/core 7.2.1
@angular-devkit/schematics 7.2.1
@angular/cli 7.2.1
@ngtools/webpack 7.2.1
@schematics/angular 7.2.1
@schematics/update 0.12.1
rxjs 6.3.3
typescript 3.2.2
webpack 4.23.1
UPDATE
Through trial and error I have discovered my problem is something to do with the IDE I am using, VS Code. When it is closed I can run any ng command, i.e. --version or serve, and it runs as quickly as I expect. When VS Code is open, AND my angular apps folder is opened in it, it slows down again.
Currently debugging trying to pinpoint what VS Code is doing to slow it down.
subodhkumar commentedon Feb 1, 2019
@filipesilva & @kzc Thanks for providing details on this.
Just wanted to know where can we find the webpack dials to check the chunk size.
Shouldnt the size of chunks be limited not to cross node limit, as it cause errors(I agree on the performance reason though).. a more info on the same would help.
Thanks again!
mp54214 commentedon Jul 7, 2019
With Angular 8 I had the same issue. I updated "@angular-devkit/build-angular": "^0.800.6"
to latest "@angular-devkit/build-angular": "^0.801.0" and ng serve build / rebuild times dropped down to what I could call normal (i.e. very quick).
angular-automatic-lock-bot commentedon Sep 9, 2019
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.