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

Rebuild extremely slow

Open asadsahi opened this issue 10 years ago • 226 comments

  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.

asadsahi avatar Sep 05 '16 10:09 asadsahi

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

MickL avatar Apr 23 '17 13:04 MickL

I upgraded a project from v2.4.10([email protected]) to 4.0.0 ( "@angular/cli": "1.0.0") and unfortunately don't see much improvements

here is stat from new cli:

> [email protected] 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:

> [email protected] 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.

ipassynk avatar Apr 23 '17 13:04 ipassynk

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

jmlivingston avatar Apr 24 '17 14:04 jmlivingston

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

flackjap avatar Apr 26 '17 19:04 flackjap

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

clydin avatar Apr 26 '17 19:04 clydin

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.

hansl avatar Apr 26 '17 20:04 hansl