Skip to content

v7.0.0 bugs and 4/5x slower serve & compile AOT #12646

Closed

Description

@elvisbegovic

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

  1. My project have >1200 files.
  2. Before update node --max-old-space-size=8192 ./node_modules/@angular/cli/bin/ng serve --aot --sourceMap=false --disableHostCheck --port=4200 first build finish in 45seconds and Now blocking:

3mn => 11% building modules 9/10 modules 1 active ...ojects\i10\src\assets\styles\styles.css and rest steps seems ok It finish in 228737ms

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

  1. 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...):
cli

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

  1. self-assigned this
    on Oct 19, 2018
  2. added this to the needsTriage milestone on Oct 19, 2018
  3. modified the milestones: needsTriage, Backlog on Oct 19, 2018
  4. modified the milestones: Backlog, on Oct 19, 2018
  5. filipesilva commented on Oct 19, 2018

    @filipesilva
    Contributor

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

  6. filipesilva commented on Oct 19, 2018

    @filipesilva
    Contributor

    @istiti can you try @@angular-devkit/build-angular@~0.10.0 and tell me if the AOT rebuild times are still very long?

  7. 88 remaining items

  8. fxck commented on Nov 28, 2018

    @fxck

    Ever since updating to

    "@angular-devkit/build-angular": "~0.11.0",
    "@angular/cli": "7.1.0"
    

    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")

  9. jtyagi commented on Nov 28, 2018

    @jtyagi

    @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"
    }
    ]
    }

  10. titov-dmytro commented on Nov 28, 2018

    @titov-dmytro

    Same here

  11. HarelM commented on Dec 2, 2018

    @HarelM

    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?

  12. no-more commented on Dec 2, 2018

    @no-more

    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

  13. parliament718 commented on Dec 16, 2018

    @parliament718

    @HarelM cli v 7.1 was unbearably slow for me. Reverting to 6.2.8 gave me a drastic improvement

  14. aalbericio commented on Dec 17, 2018

    @aalbericio

    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

  15. matheusdavidson commented on Dec 24, 2018

    @matheusdavidson

    Also have slower live reloading with angular 7. Was way quicker with angular 6.

  16. Meligy commented on Dec 25, 2018

    @Meligy
    Contributor

    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.

  17. filipesilva commented on Dec 27, 2018

    @filipesilva
    Contributor

    Just wanted to mention there was a regression in 7.1 (#13102), and we have a fix on the way for it.

  18. StuartMc77 commented on Jan 16, 2019

    @StuartMc77

    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.

  19. subodhkumar commented on Feb 1, 2019

    @subodhkumar

    To be honest I expected terser to require less memory than uglify-es, because of existing bugs that were fixed.

    @filipesilva No memory improvement was made in terser over uglify-es. Perhaps in the course of fixing bugs the memory requirement may have actually increased in some cases. If you manage to isolate a terser minify() JS input that has significantly larger memory requirements than uglify-es with the same minify options, put the JS in question into a gist and create a new terser issue.

    The one dramatic improvement for the minify time regression in collapse_vars was capping the upper bound of quadratic complexity to save CPU time - not memory.

    what can happen is that the inner module closures (the module concatenation thing I mentioned before) managed to get more code in a single module and thus require more memory to optimize, with potential better savings

    That's probably what's going on. More code was likely fed to terser in a more recent version of webpack or angular-cli. Perhaps there are webpack dials to limit the size of chunks.

    @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!

  20. mp54214 commented on Jul 7, 2019

    @mp54214

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

  21. angular-automatic-lock-bot commented on Sep 9, 2019

    @angular-automatic-lock-bot

    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.

  22. locked and limited conversation to collaborators on Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions