Skip to content

Rebuild extremely slow #1980

Closed
Closed

Description

@asadsahi
  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
    Windows 10

  2. Versions. Please run ng --version. If there's nothing outputted, please run
    in a Terminal: node --version and paste the result here:
    angular-cli: 1.0.0-beta.11-webpack.8
    node: 6.3.0
    os: win32 x64

  3. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.
    app created with 1.0.0-beta.11-webpack.2 and later on upgraded to 1.0.0-beta.11-webpack.8 with appropriate changes.

  4. The log given by the failure. Normally this include a stack trace and some
    more information.
    The slow behavious is observed when upgraded from 1.0.0-beta.11-webpack.2 to 1.0.0-beta.11-webpack.8

  5. Mention any other details that might be useful.
    Slow behavious reproduceable in following repo:
    https://github.com/asadsahi/ng2fb-bootstrap


I have experience this on two operating systems, windows 7 and windows 10. Has anyone else experieced this? For me rebuilds are dramatically slow, taking roughly 7-8 seconds which on same machine with cli version webpack.2 was taking rougly 2-3 seconds.

Activity

  1. changed the title [-]Rebuild Slow[/-] [+]Rebuild extremely slow[/+] on Sep 5, 2016
  2. stellasoft-george commented on Sep 7, 2016

    @stellasoft-george

    +1 Rebuilds are extremely slow for me on OSX 10.11.6

  3. RicardoVaranda commented on Sep 8, 2016

    @RicardoVaranda
    Contributor

    +1 also quite slow on linux x64 after I moved my assets from the app folder to the appropriate assets folder, it now optimizes the assets folder every time I make a change to any of the code which seems to be the reason for the added delay.

  4. filipesilva commented on Sep 16, 2016

    @filipesilva
    Contributor

    @TheLarkInn can you weigh in? It seems related with CopyWebpackPlugin.

  5. added
    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
    on Sep 16, 2016
  6. added
    P1Impacts a large percentage of users; if a workaround exists it is partial or overly painful
    and removed
    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
    on Sep 20, 2016
  7. added this to the milestone on Sep 20, 2016
  8. intellix commented on Sep 28, 2016

    @intellix
    Contributor

    Would DLL loading for vendor items help here? They must be 90% of bundle size

  9. 254 remaining items

  10. hccampos commented on Mar 24, 2017

    @hccampos

    @hanvyj build or rebuild? Our build times are now at nearly two minutes. Rebuilds are at 3s for no changes up to 30s in some cases. Did some profiling and it is mostly the source maps which are insanely slow. Disable them and builds become way faster...while debugging becomes a nightmare. All in all, you are still quite lucky I think. If things get really bad, there is always the option of ejecting. We have been considering it for a while.

  11. hanvyj commented on Mar 24, 2017

    @hanvyj

    Rebuild. The original build is a little longer. I've seen it as low as 46, but just then it was 88:

    Imgur

    I'll try enabling source maps only if I'm doing some serious debugging. Thanks.

    There's probably some other optimizations I can do, I'll google around a bit.

  12. clydin commented on Mar 24, 2017

    @clydin
    Member

    @hanvyj What's your command line look like?

  13. hanvyj commented on Mar 24, 2017

    @hanvyj

    I run it with an NPM command that calls "ng serve --aot=true --proxy-config proxy.conf.json":

    "startNoServer": "concurrently --kill-others \"ng serve --aot=true --proxy-config proxy.conf.json\"",
    

    I played with a project that split the vendor bundle into a separate webpack script that didn't watch for changes. (it's rarely changed), I think it was all dealing with webpack without the CLI though. Is something like that possible with the CLI (it adds so much functionality and ease of use I'd take it over a faster build and setting up webpack myself!)

  14. hccampos commented on Mar 24, 2017

    @hccampos

    That explains it. AoT is extremely slow, too slow to be used while developing.

  15. hanvyj commented on Mar 24, 2017

    @hanvyj

    Ah, so I should turn it off when developing. I guess I'd have to be careful to not cause any changes that would break an AoT production build. Gets it down to 36 seconds build time, 5 second rebuild time - which is great!

    I guess I'll have to be careful not to do anything that could break AoT though (interestingly, turning it off highlighted a few errors, a service not marked as @Injectable(), no idea how that worked with AoT on!).

    Seems my method of creating Modal dialogs is completely broken, but there's a guide here I'll give a good read: https://angular.io/docs/ts/latest/cookbook/aot-compiler.html#!#jit-dev-aot-prod

  16. cyberprodigy commented on Apr 23, 2017

    @cyberprodigy

    I have hello world project created with
    ng new HelloWorld

    then I run ng build.
    Takes 62 seconds.

    Then I change a line in hello world
    I run ng build, and it takes 62 seconds again. Is this normal? Is this how you develop?

  17. clydin commented on Apr 23, 2017

    @clydin
    Member

    @cyberprodigy please open a separate issue including the information from the template so that we can fully assist you. Please also be sure that you are using the latest version (1.0.0 at this time).
    Thank you.

  18. MickL commented on Apr 23, 2017

    @MickL

    @cyberprodigy it takes like 1 second on my machine with latest cli. You may dont have the latest installed.

  19. ipassynk commented on Apr 23, 2017

    @ipassynk

    I upgraded a project from v2.4.10(angular-cli@1.0.0-beta.20-4) to 4.0.0 ( "@angular/cli": "1.0.0") and unfortunately don't see much improvements

    here is stat from new cli:

    > promo-client@0.0.0 start /projects/ctc/5390-promo/promo-client
    > ng serve --host 0.0.0.0 --port 5555 --proxy-config proxy.conf.json -o
    
    ** NG Live Development Server is running on http://0.0.0.0:5555 **
     11% building modules 15/26 modules 11 active ...ode_modules/style-loader/addStyles.jswebpack: wait until bundHash: 4c427ff407b3e5292822                                                            
    
    Time: 27387ms
    
    chunk    {0} main.bundle.js, main.bundle.js.map (main) 1 MB {3} [initial] [rendered]
    chunk    {1} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 158 kB {4} [initial] [rendered]
    chunk    {2} styles.bundle.js, styles.bundle.js.map (styles) 295 kB {4} [initial] [rendered]
    chunk    {3} vendor.bundle.js, vendor.bundle.js.map (vendor) 5.26 MB [initial] [rendered]
    chunk    {4} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]
    webpack: Compiled successfully.
    

    and here is from old one:

    > PROMO@0.0.0 start /Users/juliapassynkova/ctc/projects/5390-promo/promo-client
    > ng serve --host 0.0.0.0 --port 5555 --proxy-config proxy.conf.json -o
    
    ** NG Live Development Server is running on http://0.0.0.0:5555. **                                                  10% building modules 3/3 modules 0 active[HPM] Proxy created: /api  ->  http://localhost:8080/promo
    [HPM] Proxy created: /oauth  ->  http://localhost:8080/promo                                                   11% building modules 15/27 modules 12 active ...odules/bootstrap/dist/js/bootstrap.jswebpack: wait until bundle finished: /                                                                         11% building modules 16/30 modules 14 active ...s/webpack-dev-server/client/socket.js(node:6412) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/issues/56
    parseQuery() will be replaced with getOptions() in the next major version of loader-utils.             22872ms building modules                              5ms add04223ms 131ms asse116ms emitting
    Hash: 8531c2e494bb70e33827
    Version: webpack 2.1.0-beta.25
    
    Time: 29684ms
                                     Asset       Size  Chunks             Chunk Names
     fee66e712a8a08eef5805a46892932ad.woff      98 kB          [emitted]  
      bce071e976865da511003c50333620c5.eot    2.52 kB          [emitted]  
      b0aebd744ce7adb780a9342fd395535e.svg    2.67 kB          [emitted]  
      89889688147bd7575d6327160d64e760.svg     109 kB          [emitted]  
      674f50d287a8c48dc19ba404d20fe713.eot     166 kB          [emitted]  
      912ec66d7572ff821749319396470bde.svg     444 kB          [emitted]  
      e18bbf611f2a2e43afc071aa2f4e1512.ttf    45.4 kB          [emitted]  
     fa2772327f55d8198301fdb8bcfc8158.woff    23.4 kB          [emitted]  
    448c34a56d699c29117adc64c43affeb.woff2      18 kB          [emitted]  
      b06871f281fee6b241d60582ae9369b9.ttf     166 kB          [emitted]  
    af7ae505a9eed503f8b8e6982036873e.woff2    77.2 kB          [emitted]  
      f4769f9bdb7466be65088239c12046d1.eot    20.1 kB          [emitted]  
      d329cc8b34667f114a95422aaad1b063.ttf     162 kB          [emitted]  
      ac3f799d5bbaf5196fab15ab8de8431c.ttf     163 kB          [emitted]  
                            main.bundle.js    7.46 MB    0, 3  [emitted]  main
                          styles.bundle.js     295 kB    1, 3  [emitted]  styles
                         scripts.bundle.js     376 kB    2, 3  [emitted]  scripts
                          inline.bundle.js    5.53 kB       3  [emitted]  inline
                                  main.map     7.9 MB    0, 3  [emitted]  main
                                styles.map     397 kB    1, 3  [emitted]  styles
                               scripts.map     462 kB    2, 3  [emitted]  scripts
                                inline.map     5.6 kB       3  [emitted]  inline
                                index.html  783 bytes          [emitted]  
    Child html-webpack-plugin for "index.html":
             Asset     Size  Chunks       Chunk Names
        index.html  3.17 kB       0       
    webpack: Compiled successfully.
    [default] Checking started in a separate process...
    [default] Ok, 2.852 sec.
    
  20. jmlivingston commented on Apr 24, 2017

    @jmlivingston

    @cyberprodigy - If you are running it locally for development purposes, you should be using "ng serve", not "ng build".

  21. flackjap commented on Apr 26, 2017

    @flackjap

    I'm having the same issues.

    Build takes 30 seconds on average.
    Yes, I'm using ng serve, without any options and it was slow from the very beginning (clean ng cli).

    I'm using Vagrant for development environment. I guess it could slow it down a bit, but I wouldn't expect this much.

    It seems that it is compiling all modules everytime (even those from /node_modules) and doing chunk asset optimizations (probably for all assets). Is it developed that way or I am missing something in my configuration?

    selection_090


    @angular/cli: 1.0.0
    node: 6.10.0
    os: linux x64
    @angular/common: 4.0.2
    @angular/compiler: 4.0.2
    @angular/core: 4.0.2
    @angular/forms: 4.0.2
    @angular/http: 4.0.2
    @angular/platform-browser: 4.0.2
    @angular/platform-browser-dynamic: 4.0.2
    @angular/router: 4.0.2
    @angular/cli: 1.0.0
    @angular/compiler-cli: 4.0.2

  22. clydin commented on Apr 26, 2017

    @clydin
    Member

    Ng serve watches for changes and rebuilds only the changed chunks automatically. Killing the process each time forces a full build.

  23. hansl commented on Apr 26, 2017

    @hansl
    Contributor

    What @clydin said, basically. Build times will not improve much (although webpack itself is reporting improvements so we shall see); rebuilding time should be much faster. Keep your process running and you'll see improvements.

    Locking this conversation down. This issue has been resolved a long time ago.

  24. locked and limited conversation to collaborators on Apr 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfultype: bug/fixtype: faq

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions