Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extremely slow ng serve performance [Source Map compiling] #13087

Closed
djleonskennedy opened this issue Nov 29, 2018 · 35 comments
Closed

Extremely slow ng serve performance [Source Map compiling] #13087

djleonskennedy opened this issue Nov 29, 2018 · 35 comments
Labels
area: ngtools/webpack needs: investigation Requires some digging to determine if action is needed severity5: regression
Milestone

Comments

@djleonskennedy
Copy link

Bug Report or Feature Request (mark with an x)

- [x ] bug report
- [ ] feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [x ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

npm: 5.6.0

Angular CLI: 7.0.6
Node: 8.9.4
OS: win32 x64
Angular: 7.0.4
... animations, common, compiler, core, forms, http
... platform-browser, platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.10.6
@angular-devkit/build-angular 0.10.6
@angular-devkit/build-optimizer 0.10.6
@angular-devkit/build-webpack 0.10.6
@angular-devkit/core 7.0.6
@angular-devkit/schematics 7.0.6
@angular/cdk 7.1.0
@angular/cli 7.0.6
@angular/compiler-cli 7.1.0
@angular/flex-layout 7.0.0-beta.19
@angular/language-service 7.1.0
@ngtools/webpack 7.0.6
@schematics/angular 7.0.6
@schematics/update 0.10.6
rxjs 6.3.3
typescript 3.1.6
webpack 4.19.1

Repro steps

Needs LARGE project, NOT empty project with ng new ...,
run npm start
make changes
wait for 10 min

The log given by the failure

N/A

Desired functionality

We have big project, and we've faced problem with ng serve updating/recompiling during update.
Now faster to re-run ng serve instead wait for rebuilding

Mention any other details that might be useful

we use simple ng serve without AOT or PROD flag

@jmsegrev
Copy link

jmsegrev commented Nov 30, 2018

I'm having similar performance problems with ng server after updating my large project to 7.1.0.

@ngbot ngbot bot added this to the needsTriage milestone Dec 3, 2018
@alan-agius4
Copy link
Collaborator

alan-agius4 commented Dec 3, 2018

Hi @djleonskennedy, does turning off the sourceMaps result in good rebuild times? Also is vendorSourceMap enabled or disabled?

When you say large project, can you kindly provide some data such as number of Ts files, Css/Scss files etc?

Thanks.

@alan-agius4 alan-agius4 added the needs: more info Reporter must clarify the issue label Dec 3, 2018
@mselerin
Copy link

mselerin commented Dec 3, 2018

Hi,
This could help investigating the issue...

With a fresh project (ng new with all default parameters), ng serve complete after 15sec. Then :

  • 1st change: 3901ms
  • 2nd change: 2516ms
  • 3rd change: 2125ms
  • 4th change: 2068ms

After reverting @angular-devkit/build-angular to 0.10.7, I get the following times :

  • 1st change: 2584ms
  • 2nd change: 477ms
  • 3rd change: 477ms
  • 4th change: 432ms

@djleonskennedy
Copy link
Author

@alan-agius4 I'll check it vendorSourceMap, will let you know asap, Thank you

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Dec 3, 2018

@mselerin your issue doesn’t seem to be related to sourcemaps.

But more to this issue: #13102

@mselerin
Copy link

mselerin commented Dec 3, 2018

@alan-agius4 I have seen this issue before but I don't think it's related to mine... (it's not aot but jit with serve)

But thanks for the reply :-)

@djleonskennedy
Copy link
Author

djleonskennedy commented Dec 4, 2018

@alan-agius4 Summary of out app

We have SharedModule for common components, pipes etc.
We have 219 lazy loaded modules, we use lazy loading every where
In general we have over 80 000 lines of types script

Could you say what i can provide for you to get more info?

Thank you :)

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Dec 4, 2018

Hi,

Thanks for the info provided. If you don't mind can you try a couple of things that will help is determine what's the root cause.

  1. Can you check how are the build/rebuild times with sourceMap turned off?

  2. Can you confirm if you have vendorSourceMap enabled or disabled?

  3. Can you open node_modules/@ngtools/webpack/src/benchmark.js, Change const _benchmark = false to true and run ng serve --verbose --no-progress it should indicate which parts of the compilation is taking more time. (Would be great if you could post the timings here of an initial and incremental build, and the console timings). Or preferably you can profile the ng serve using NG_CLI_PROFILING enviorment variable. So something like NG_CLI_PROFILING=$HOME/build ng serve would record and generate a CPU profile that chrome can load and show you performance analysis and provide a link to it here.

  4. And out of curiosity can you also run npm ls webpack-sources? This should not return any version prior to 1.2.0.

@djleonskennedy
Copy link
Author

@alan-agius4 will try asap, thank you

@samfrach
Copy link

samfrach commented Dec 4, 2018

Hello,
I had exactly the same issue tonight... and I found one solution ....

package.json/devDependencies :
I downgraded from 0.11
"@angular-devkit/build-angular": "^0.6.8",

and now it is fast (1.2 sec).... (without aot)
then I tested 0.8.8 ... it is OK (1.2 sec)
then I tested 0.10.7 ... slow for the first change (8 sec), then OK
then I tested 0.12.0-beta.0 .. it is not OK (11 seconds at 1st, 2nd, 3rd change)
so I go back to 0.10.7 ....

For me, it is still ~50 seconds for ng serve .. but then a change is 1 second instead of 12 seconds with 0.11
(with --aot it is 157 seconds to serve and between 50 and 157 for a basic change)

My Config :

Angular CLI: 7.1.1
Node: 10.14.1
OS: win32 x64
Angular: 7.1.1
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, language-service, material, platform-browser
... platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.6.8
@angular-devkit/build-angular 0.6.8
@angular-devkit/build-optimizer 0.6.8
@angular-devkit/core 0.6.8
@angular-devkit/schematics 7.1.1
@ngtools/webpack 6.0.8
@schematics/angular 7.1.1
@schematics/update 0.11.1
rxjs 6.3.3
typescript 3.1.3
webpack 4.8.3

@mselerin
Copy link

mselerin commented Dec 5, 2018

I have made some test with const _benchmark = true; and @angular-devkit/build-angular 0.11.1 vs 0.10.7.

What I see is AngularCompilerPlugin._createOrUpdateProgram.ts.createProgram slower in 0.11.1 :

Run v0.11.1 v0.10.7
1st 5737.993ms 3809.414ms
2nd 3647.592ms 132.386ms
3rd 3084.749ms 52.066ms

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Dec 6, 2018

@mselerin do you see the same perf regression when using @ngtools/webpack 7.0.6?

@djleonskennedy
Copy link
Author

@alan-agius4 After changed file compiled, compile start compile these files

i 「wdm」: Compiled successfully.
i 「wdm」: Compiling...
i 「wdm」: wait until bundle finished: /runtime.js.map
i 「wdm」: wait until bundle finished: /polyfills.js.map
i 「wdm」: wait until bundle finished: /styles.js.map
i 「wdm」: wait until bundle finished: /OpenSans-Regular.ttf
i 「wdm」: wait until bundle finished: /assets/configs/main.json
i 「wdm」: wait until bundle finished: /main.js.map

why is it happening ?

@djleonskennedy
Copy link
Author

@alan-agius4 Also i reverted our project to commit where we had version 6.1.0, and all compiles fast on ng serve

@mselerin
Copy link

mselerin commented Dec 6, 2018

@alan-agius4

@mselerin do you see the same perf regression when using @ngtools/webpack 7.0.6?

I'm using @ngtools/webpack 7.0.7 but @angular-devkit/build-angular 0.10.7.

@elvirdolic
Copy link

elvirdolic commented Dec 7, 2018

We have the same issue, from fromerly about 5-10s to now 15-30s

I don't know which version introduced this exactly. I think @angular/cli 7.1*

What exactly do you need from us to give more insights on this. There is definitely something.

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Dec 7, 2018

Hi all, one of the performance regression was fixed in 7.1.2 with #13133.

If the problem persists it would be great if you could provide a CPU profiling snapshot. You can see how to do this in #13087 (comment)

Thanks.

@igorivaniuk
Copy link

"@angular-devkit/build-angular": "0.11.2",

> ng serve --configuration hmr --source-map=false --proxy-config proxy.json

NOTICE: Hot Module Replacement (HMR) is enabled for the dev server.
The project will still live reload when HMR is enabled,
but to take advantage of HMR additional application code is required'
(not included in an Angular CLI project by default).'
See https://webpack.js.org/guides/hot-module-replacement
for information on working with HMR for Webpack.
To disable this warning use "hmrWarning: false" under "serve" options in "angular.json".
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **

Date: 2018-12-07T13:22:49.019Z
Hash: b416e7853a5322072f25
Time: 9421ms
chunk {main} main.js (main) 188 kB [initial] [rendered]
chunk {polyfills} polyfills.js (polyfills) 223 kB [initial] [rendered]
chunk {runtime} runtime.js (runtime) 31 kB [entry] [rendered]
chunk {styles} styles.js (styles) 91.8 kB [initial] [rendered]
chunk {vendor} vendor.js (vendor) 7.6 MB [initial] [rendered]
ℹ 「wdm」: Compiled successfully.
ℹ 「wdm」: Compiling...
                                                                                     
Date: 2018-12-07T13:22:57.878Z - Hash: 90f108e5324c906a6e8b - Time: 4662ms
3 unchanged chunks
chunk {main} main.js, main.b416e7853a5322072f25.hot-update.js (main) 188 kB [initial] [rendered]
chunk {runtime} runtime.js (runtime) 31 kB [entry] [rendered]
ℹ 「wdm」: Compiled successfully.
ℹ 「wdm」: Compiling...
                                                                                     
Date: 2018-12-07T13:23:00.790Z - Hash: a20a843fc0e253f24cbe - Time: 1222ms
3 unchanged chunks
chunk {main} main.js, main.90f108e5324c906a6e8b.hot-update.js (main) 188 kB [initial] [rendered]
chunk {runtime} runtime.js (runtime) 31 kB [entry] [rendered]
ℹ 「wdm」: Compiled successfully.
ℹ 「wdm」: Compiling...
                                                                                     
Date: 2018-12-07T13:23:04.032Z - Hash: 3125448d364b4d38d1db - Time: 1405ms
3 unchanged chunks
chunk {main} main.js, main.a20a843fc0e253f24cbe.hot-update.js (main) 188 kB [initial] [rendered]
chunk {runtime} runtime.js (runtime) 31 kB [entry] [rendered]
ℹ 「wdm」: Compiled successfully.
ℹ 「wdm」: Compiling...
                                                                                     
Date: 2018-12-07T13:23:06.921Z - Hash: 8c156bd1d0d7ebd09ef6 - Time: 1020ms
3 unchanged chunks
chunk {main} main.js, main.3125448d364b4d38d1db.hot-update.js (main) 188 kB [initial] [rendered]
chunk {runtime} runtime.js (runtime) 31 kB [entry] [rendered]
ℹ 「wdm」: Compiled successfully.
ℹ 「wdm」: Compiling...
                                                                                     
Date: 2018-12-07T13:23:10.300Z - Hash: 234b00c1d341b51f980b - Time: 1210ms
3 unchanged chunks
chunk {main} main.js, main.8c156bd1d0d7ebd09ef6.hot-update.js (main) 188 kB [initial] [rendered]
chunk {runtime} runtime.js (runtime) 31 kB [entry] [rendered]
ℹ 「wdm」: Compiled successfully.
ℹ 「wdm」: Compiling...
                                                                                     
Date: 2018-12-07T13:23:13.548Z - Hash: 970a99eb904f833c623e - Time: 1148ms
3 unchanged chunks
chunk {main} main.js, main.234b00c1d341b51f980b.hot-update.js (main) 188 kB [initial] [rendered]
chunk {runtime} runtime.js (runtime) 31 kB [entry] [rendered]
ℹ 「wdm」: Compiled successfully.

"@angular-devkit/build-angular": "0.10.7",

> ng serve --configuration hmr --source-map=false --proxy-config proxy.json

NOTICE: Hot Module Replacement (HMR) is enabled for the dev server.
The project will still live reload when HMR is enabled,
but to take advantage of HMR additional application code is required'
(not included in an Angular CLI project by default).'
See https://webpack.js.org/guides/hot-module-replacement
for information on working with HMR for Webpack.
To disable this warning use "hmrWarning: false" under "serve" options in "angular.json".
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
                                                                                         
Date: 2018-12-07T13:23:50.468Z
Hash: 65b0847d76a51bfbd8b2
Time: 9321ms
chunk {main} main.js (main) 188 kB [initial] [rendered]
chunk {polyfills} polyfills.js (polyfills) 223 kB [initial] [rendered]
chunk {runtime} runtime.js (runtime) 30.9 kB [entry] [rendered]
chunk {styles} styles.js (styles) 91.8 kB [initial] [rendered]
chunk {vendor} vendor.js (vendor) 7.6 MB [initial] [rendered]
ℹ 「wdm」: Compiled successfully.
ℹ 「wdm」: Compiling...
                                                                                     
Date: 2018-12-07T13:23:57.692Z - Hash: fd7e8f2bbafcc6fc6043 - Time: 2466ms
3 unchanged chunks
chunk {main} main.js, main.65b0847d76a51bfbd8b2.hot-update.js (main) 188 kB [initial] [rendered]
chunk {runtime} runtime.js (runtime) 30.9 kB [entry] [rendered]
ℹ 「wdm」: Compiled successfully.
ℹ 「wdm」: Compiling...
                                                                                     
Date: 2018-12-07T13:23:59.870Z - Hash: 025934ad5de9f53cd69a - Time: 171ms
3 unchanged chunks
chunk {main} main.js, main.fd7e8f2bbafcc6fc6043.hot-update.js (main) 188 kB [initial] [rendered]
chunk {runtime} runtime.js (runtime) 30.9 kB [entry] [rendered]
ℹ 「wdm」: Compiled successfully.
ℹ 「wdm」: Compiling...
                                                                                     
Date: 2018-12-07T13:24:03.478Z - Hash: e2286f4ba43aaf5ee50c - Time: 142ms
3 unchanged chunks
chunk {main} main.js, main.025934ad5de9f53cd69a.hot-update.js (main) 188 kB [initial] [rendered]
chunk {runtime} runtime.js (runtime) 30.9 kB [entry] [rendered]
ℹ 「wdm」: Compiled successfully.
ℹ 「wdm」: Compiling...
                                                                                     
Date: 2018-12-07T13:24:05.823Z - Hash: 02437b7e4b548697a579 - Time: 152ms
3 unchanged chunks
chunk {main} main.js, main.e2286f4ba43aaf5ee50c.hot-update.js (main) 188 kB [initial] [rendered]
chunk {runtime} runtime.js (runtime) 30.9 kB [entry] [rendered]
ℹ 「wdm」: Compiled successfully.
ℹ 「wdm」: Compiling...
                                                                                     
Date: 2018-12-07T13:24:07.655Z - Hash: bbfc71466b67d8a7fe85 - Time: 156ms
3 unchanged chunks
chunk {main} main.js, main.02437b7e4b548697a579.hot-update.js (main) 188 kB [initial] [rendered]
chunk {runtime} runtime.js (runtime) 30.9 kB [entry] [rendered]
ℹ 「wdm」: Compiled successfully.

@igorivaniuk
Copy link

igorivaniuk commented Dec 7, 2018

@alan-agius4

Short version profiling "@angular-devkit/build-angular": "0.11.2",

Full log are about 3.3MB

> ng serve --configuration hmr --source-map=false --vendorSourceMap=false --verbose --no-progress --proxy-config proxy.json

AngularCompilerPlugin._setupOptions: 4.877ms
The project will still live reload when HMR is enabled,
but to take advantage of HMR additional application code is required'
(not included in an Angular CLI project by default).'
See https://webpack.js.org/guides/hot-module-replacement
for information on working with HMR for Webpack.
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
AngularCompilerPlugin._createOrUpdateProgram.ts.createProgram: 2294.050ms
AngularCompilerPlugin._make.resolveEntryModuleFromMain: 3.720ms
AngularCompilerPlugin._emit.ts.getOptionsDiagnostics: 0.125ms
AngularCompilerPlugin._emit.ts.gatherDiagnostics.ts.getSyntacticDiagnostics: 0.738ms
AngularCompilerPlugin._emit.ts.gatherDiagnostics.ts.getSemanticDiagnostics: 3274.518ms
AngularCompilerPlugin._emit: 3589.411ms
AngularCompilerPlugin._update._emit: 3589.785ms
AngularCompilerPlugin._update: 6750.572ms
AngularCompilerPlugin._make: 6750.802ms
ngcLoader+/src/main.ts+.ngcLoader.AngularCompilerPlugin: 5.950ms
ngcLoader+/src/main.ts+: 58.028ms
ngcLoader+/src/polyfills.ts+.ngcLoader.AngularCompilerPlugin: 60.054ms
ngcLoader+/src/polyfills.ts+: 70.753ms
�[34mℹ�[39m �[90m「wdm」�[39m: wait until bundle finished: /site/1/settings/analytics
ngcLoader+/src/hmr.ts+.ngcLoader.AngularCompilerPlugin: 0.027ms
ngcLoader+/src/hmr.ts+: 2.814ms
ngcLoader+/src/app/app.module.ts+.ngcLoader.AngularCompilerPlugin: 0.011ms
ngcLoader+/src/app/app.module.ts+: 2.242ms
ngcLoader+/src/environments/environment.ts+.ngcLoader.AngularCompilerPlugin: 0.011ms
ngcLoader+/src/environments/environment.ts+: 0.557ms
ngcLoader+/src/app/app-routing.module.ts+.ngcLoader.AngularCompilerPlugin: 0.011ms
ngcLoader+/src/app/app-routing.module.ts+: 1.890ms
ngcLoader+/src/app/app.component.ts+.ngcLoader.AngularCompilerPlugin: 0.012ms
ngcLoader+/src/app/app.component.ts+: 0.983ms
ngcLoader+/src/app/core/core.module.ts+.ngcLoader.AngularCompilerPlugin: 0.010ms
ngcLoader+/src/app/core/core.module.ts+: 9.033ms
ngcLoader+/src/app/shared/shared.module.ts+.ngcLoader.AngularCompilerPlugin: 0.012ms
ngcLoader+/src/app/shared/shared.module.ts+: 2.889ms
ngcLoader+/src/app/site/site.module.ts+.ngcLoader.AngularCompilerPlugin: 0.009ms
ngcLoader+/src/app/site/site.module.ts+: 4.232ms
ngcLoader+/src/app/sites/sites.module.ts+.ngcLoader.AngularCompilerPlugin: 0.012ms
ngcLoader+/src/app/sites/sites.module.ts+: 2.769ms
ngcLoader+/src/app/site/site-sections.resolver.ts+.ngcLoader.AngularCompilerPlugin: 0.009ms
ngcLoader+/src/app/site/site-sections.resolver.ts+: 3.261ms
ngcLoader+/src/app/site/site.resolver.ts+.ngcLoader.AngularCompilerPlugin: 0.008ms
ngcLoader+/src/app/site/site.resolver.ts+: 0.704ms
ngcLoader+/src/app/auth/auth.interceptor.ts+.ngcLoader.AngularCompilerPlugin: 0.008ms
ngcLoader+/src/app/auth/auth.interceptor.ts+: 1.485ms
ngcLoader+/src/app/auth/auth.module.ts+.ngcLoader.AngularCompilerPlugin: 0.009ms
ngcLoader+/src/app/auth/auth.module.ts+: 1.000ms
ngcLoader+/src/app/auth/pages/login/login.component.ts+.ngcLoader.AngularCompilerPlugin: 0.073ms
ngcLoader+/src/app/auth/pages/login/login.component.ts+: 1.338ms
ngcLoader+/src/app/auth/state/user.state.ts+.ngcLoader.AngularCompilerPlugin: 0.048ms
ngcLoader+/src/app/auth/state/user.state.ts+: 2.442ms
ngcLoader+/src/app/site/state/current-site.state.ts+.ngcLoader.AngularCompilerPlugin: 0.009ms
ngcLoader+/src/app/site/state/current-site.state.ts+: 1.814ms
ngcLoader+/src/app/sites/state/sites.state.ts+.ngcLoader.AngularCompilerPlugin: 0.007ms
ngcLoader+/src/app/sites/state/sites.state.ts+: 2.039ms
ngcLoader+/src/app/core/state/app.state.ts+.ngcLoader.AngularCompilerPlugin: 0.007ms
ngcLoader+/src/app/core/state/app.state.ts+: 0.892ms
ngcLoader+/src/app/shared/material/material.module.ts+.ngcLoader.AngularCompilerPlugin: 0.023ms
ngcLoader+/src/app/shared/material/material.module.ts+: 2.966ms
ngcLoader+/src/app/shared/components/error-block/error-block.component.ts+.ngcLoader.AngularCompilerPlugin: 0.010ms
ngcLoader+/src/app/shared/components/error-block/error-block.component.ts+: 7.288ms
ngcLoader+/src/app/shared/components/inline-loader/inline-loader.component.ts+.ngcLoader.AngularCompilerPlugin: 0.010ms
ngcLoader+/src/app/shared/components/inline-loader/inline-loader.component.ts+: 1.013ms
ngcLoader+/src/app/site/pages/dashboard/dashboard.component.ts+.ngcLoader.AngularCompilerPlugin: 0.007ms
ngcLoader+/src/app/site/pages/dashboard/dashboard.component.ts+: 1.044ms
ngcLoader+/src/app/site/pages/site-root/site-root.component.ts+.ngcLoader.AngularCompilerPlugin: 0.007ms
ngcLoader+/src/app/site/pages/site-root/site-root.component.ts+: 1.353ms
ngcLoader+/src/app/site/pages/settings/settings.component.ts+.ngcLoader.AngularCompilerPlugin: 0.007ms
ngcLoader+/src/app/site/pages/settings/settings.component.ts+: 0.663ms
ngcLoader+/src/app/site/pages/settings-main/settings-main.component.ts+.ngcLoader.AngularCompilerPlugin: 0.008ms
ngcLoader+/src/app/site/pages/settings-main/settings-main.component.ts+: 3.919ms
ngcLoader+/src/app/site/pages/settings-sections/settings-sections.component.ts+.ngcLoader.AngularCompilerPlugin: 0.009ms
ngcLoader+/src/app/site/pages/settings-sections/settings-sections.component.ts+: 1.916ms
ngcLoader+/src/app/site/pages/settings-design/settings-design.component.ts+.ngcLoader.AngularCompilerPlugin: 0.010ms
ngcLoader+/src/app/site/pages/settings-design/settings-design.component.ts+: 1.082ms
ngcLoader+/src/app/site/pages/settings-analytics/settings-analytics.component.ts+.ngcLoader.AngularCompilerPlugin: 0.010ms
ngcLoader+/src/app/site/pages/settings-analytics/settings-analytics.component.ts+: 0.776ms
ngcLoader+/src/app/site/pages/settings-domain/settings-domain.component.ts+.ngcLoader.AngularCompilerPlugin: 0.008ms
ngcLoader+/src/app/site/pages/settings-domain/settings-domain.component.ts+: 0.927ms
ngcLoader+/src/app/site/components/left-menu/left-menu.component.ts+.ngcLoader.AngularCompilerPlugin: 0.009ms
ngcLoader+/src/app/site/components/left-menu/left-menu.component.ts+: 1.415ms
ngcLoader+/src/app/site/components/section-form/section-form.component.ts+.ngcLoader.AngularCompilerPlugin: 0.007ms
ngcLoader+/src/app/site/components/section-form/section-form.component.ts+: 2.076ms
ngcLoader+/src/app/sites/pages/site-create/site-create.component.ts+.ngcLoader.AngularCompilerPlugin: 0.104ms
ngcLoader+/src/app/sites/pages/site-create/site-create.component.ts+: 3.185ms
ngcLoader+/src/app/sites/pages/sites-list/sites-list.component.ts+.ngcLoader.AngularCompilerPlugin: 0.009ms
ngcLoader+/src/app/sites/pages/sites-list/sites-list.component.ts+: 1.591ms
ngcLoader+/src/app/site/state/current-site.actions.ts+.ngcLoader.AngularCompilerPlugin: 0.070ms
ngcLoader+/src/app/site/state/current-site.actions.ts+: 1.526ms
ngcLoader+/src/app/auth/state/user.actions.ts+.ngcLoader.AngularCompilerPlugin: 0.075ms
ngcLoader+/src/app/auth/state/user.actions.ts+: 0.820ms
ngcLoader+/src/app/api/index.ts+.ngcLoader.AngularCompilerPlugin: 0.138ms
ngcLoader+/src/app/api/index.ts+: 0.617ms
ngcLoader+/src/app/sites/state/sites.actions.ts+.ngcLoader.AngularCompilerPlugin: 0.053ms
ngcLoader+/src/app/sites/state/sites.actions.ts+: 1.269ms
ngcLoader+/src/app/api/api.module.ts+.ngcLoader.AngularCompilerPlugin: 0.010ms
ngcLoader+/src/app/api/api.module.ts+: 1.538ms
ngcLoader+/src/app/api/configuration.ts+.ngcLoader.AngularCompilerPlugin: 0.049ms
ngcLoader+/src/app/api/configuration.ts+: 0.741ms
ngcLoader+/src/app/api/variables.ts+.ngcLoader.AngularCompilerPlugin: 0.008ms
ngcLoader+/src/app/api/variables.ts+: 0.384ms
ngcLoader+/src/app/api/api/api.ts+.ngcLoader.AngularCompilerPlugin: 0.007ms
ngcLoader+/src/app/api/api/api.ts+: 0.669ms
ngcLoader+/src/app/api/model/models.ts+.ngcLoader.AngularCompilerPlugin: 0.007ms
ngcLoader+/src/app/api/model/models.ts+: 0.351ms
ngcLoader+/src/app/core/state/app.actions.ts+.ngcLoader.AngularCompilerPlugin: 0.007ms
ngcLoader+/src/app/core/state/app.actions.ts+: 0.601ms
ngcLoader+/src/app/api/api/default.service.ts+.ngcLoader.AngularCompilerPlugin: 0.119ms
ngcLoader+/src/app/api/api/default.service.ts+: 2.116ms
ngcLoader+/src/app/api/api/sites.service.ts+.ngcLoader.AngularCompilerPlugin: 0.031ms
ngcLoader+/src/app/api/api/sites.service.ts+: 2.671ms
ngcLoader+/src/app/api/api/users.service.ts+.ngcLoader.AngularCompilerPlugin: 0.039ms
ngcLoader+/src/app/api/api/users.service.ts+: 4.692ms
ngcLoader+/src/app/api/model/createSiteDto.ts+.ngcLoader.AngularCompilerPlugin: 0.016ms
ngcLoader+/src/app/api/model/createSiteDto.ts+: 0.406ms
ngcLoader+/src/app/api/model/updateSiteDto.ts+.ngcLoader.AngularCompilerPlugin: 0.006ms
ngcLoader+/src/app/api/model/updateSiteDto.ts+: 0.395ms
Hash: 061925d988bf5d4295c0
Version: webpack 4.23.1
Time: 10976ms
Built at: 12/07/2018 3:34:51 PM
       Asset       Size     Chunks                    Chunk Names
 favicon.ico    5.3 KiB             [emitted]         
  index.html  787 bytes             [emitted]         
     main.js    188 KiB       main  [emitted]         main
polyfills.js    223 KiB  polyfills  [emitted]         polyfills
  runtime.js     31 KiB    runtime  [emitted]         runtime
   styles.js   91.8 KiB     styles  [emitted]         styles
   vendor.js    7.6 MiB     vendor  [emitted]  [big]  vendor
Entrypoint main [big] = runtime.js vendor.js main.js
Entrypoint polyfills [big] = runtime.js polyfills.js
Entrypoint styles = runtime.js styles.js
chunk {main} main.js (main) 96.4 KiB ={runtime}= ={vendor}= [initial] [rendered]
 [0] multi (webpack)-dev-server/client?http://0.0.0.0:0 webpack/hot/dev-server ./src/main.ts 52 bytes {main} [built]
     multi entry
�[34mℹ�[39m �[90m「wdm」�[39m: Compiled successfully.






�[34mℹ�[39m �[90m「wdm」�[39m: Compiling...
TypeChecker.constructor: 1.015ms
TypeChecker.message: 2.177ms
TypeChecker._update: 2.469ms
AngularCompilerPlugin._createOrUpdateProgram.ts.createProgram: 3027.450ms
AngularCompilerPlugin._emit.ts.gatherDiagnostics.ts.getSyntacticDiagnostics: 0.591ms
AngularCompilerPlugin._emit: 0.784ms
AngularCompilerPlugin._update._emit: 0.863ms
AngularCompilerPlugin._update: 4064.357ms
AngularCompilerPlugin._make: 4064.398ms
ngcLoader+/src/app/sites/pages/site-create/site-create.component.ts+.ngcLoader.AngularCompilerPlugin: 1017.166ms
ngcLoader+/src/app/sites/pages/site-create/site-create.component.ts+: 1022.723ms
TypeChecker._createOrUpdateProgram.ts.createProgram: 4157.565ms
Hash: 56ae977e5ea851a52713
Version: webpack 4.23.1
Time: 4207ms
Built at: 12/07/2018 3:35:04 PM
                                  Asset       Size     Chunks                    Chunk Names
   061925d988bf5d4295c0.hot-update.json   46 bytes             [emitted]         
                             index.html  873 bytes             [emitted]         
main.061925d988bf5d4295c0.hot-update.js   2.92 KiB       main  [emitted]         main
                                main.js    188 KiB       main  [emitted]         main
                           polyfills.js    223 KiB  polyfills                    polyfills
                             runtime.js     31 KiB    runtime  [emitted]         runtime
                              styles.js   91.8 KiB     styles                    styles
                              vendor.js    7.6 MiB     vendor             [big]  vendor
Entrypoint main [big] = runtime.js vendor.js main.js main.061925d988bf5d4295c0.hot-update.js
Entrypoint polyfills [big] = runtime.js polyfills.js
Entrypoint styles = runtime.js styles.js

�[34mℹ�[39m �[90m「wdm」�[39m: Compiled successfully.
TypeChecker.gatherDiagnostics.ts.getSemanticDiagnostics: 3357.085ms
TypeChecker.message: 7517.797ms







�[34mℹ�[39m �[90m「wdm」�[39m: Compiling...
TypeChecker._update: 0.111ms
TypeChecker._createOrUpdateProgram.ts.createProgram: 5.333ms
AngularCompilerPlugin._createOrUpdateProgram.ts.createProgram: 5.455ms
AngularCompilerPlugin._emit.ts.gatherDiagnostics.ts.getSyntacticDiagnostics: 0.990ms
AngularCompilerPlugin._emit: 1.256ms
AngularCompilerPlugin._update._emit: 1.306ms
AngularCompilerPlugin._update: 1509.336ms
AngularCompilerPlugin._make: 1509.380ms
ngcLoader+/src/app/sites/pages/site-create/site-create.component.ts+.ngcLoader.AngularCompilerPlugin: 1486.839ms
ngcLoader+/src/app/sites/pages/site-create/site-create.component.ts+: 1498.500ms
Hash: 2dc4345e5ae985928ae8
Version: webpack 4.23.1
Time: 1716ms
Built at: 12/07/2018 3:35:10 PM
                                  Asset       Size     Chunks                    Chunk Names
   56ae977e5ea851a52713.hot-update.json   46 bytes             [emitted]         
                             index.html  873 bytes             [emitted]         
main.56ae977e5ea851a52713.hot-update.js   2.92 KiB       main  [emitted]         main
                                main.js    188 KiB       main  [emitted]         main
                           polyfills.js    223 KiB  polyfills                    polyfills
                             runtime.js     31 KiB    runtime  [emitted]         runtime
                              styles.js   91.8 KiB     styles                    styles
                              vendor.js    7.6 MiB     vendor             [big]  vendor
Entrypoint main [big] = runtime.js vendor.js main.js main.56ae977e5ea851a52713.hot-update.js
Entrypoint polyfills [big] = runtime.js polyfills.js
Entrypoint styles = runtime.js styles.js

�[34mℹ�[39m �[90m「wdm」�[39m: Compiled successfully.
TypeChecker.gatherDiagnostics.ts.getSemanticDiagnostics: 2533.606ms
TypeChecker.message: 2539.446ms

@alan-agius4 alan-agius4 added needs: investigation Requires some digging to determine if action is needed severity5: regression and removed needs: more info Reporter must clarify the issue labels Dec 9, 2018
@alan-agius4
Copy link
Collaborator

@igorivaniuk it would be great if you could upload the log somewhere and provide link here.

@djleonskennedy
Copy link
Author

@alan-agius4 I've updated to 0.11.2

i've started with
npm run proxy && ng serve --source-map=false --vendorSourceMap=false --verbose --no-progress --proxy-config proxy.conf.dev.json

then i just added debugger to constructor in random component

and get 90 sec recompile with next log

log file: https://dropmefiles.com/yxp7B

@igorivaniuk
Copy link

@alan-agius4 here full log https://dropmefiles.com/l1H1Y

@djleonskennedy
Copy link
Author

djleonskennedy commented Dec 10, 2018

@alan-agius4 Also the longest part
when compiling is finished, dev servers show this

i 「wdm」: Compiled successfully.
i 「wdm」: Compiling...
i 「wdm」: wait until bundle finished: /runtime.js
i 「wdm」: wait until bundle finished: /polyfills.js
i 「wdm」: wait until bundle finished: /styles.js
i 「wdm」: wait until bundle finished: /scripts.js
i 「wdm」: wait until bundle finished: /vendor.js
i 「wdm」: wait until bundle finished: /main.js
Date: 2018-12-10T12:33:03.273Z - Hash: 20e56d973a6541e3360f - Time: 98224ms
216 unchanged chunks
i 「wdm」: Compiled successfully.
i 「wdm」: Compiling...
i 「wdm」: wait until bundle finished: /scripts.js.map
i 「wdm」: wait until bundle finished: /styles.js.map
i 「wdm」: wait until bundle finished: /assets/i18n/de.json
i 「wdm」: wait until bundle finished: /assets/i18n/en.json
i 「wdm」: wait until bundle finished: /containers-products-container-products-container-module.js
i 「wdm」: wait until bundle finished: /common.js

Why is it so long ? I guess it should not be recompiled each time

@AndriiDidkivsky
Copy link

Same issue.
Any workarounds ?

@igorivaniuk
Copy link

@AndriiDidkivsky downgrade @angular-devkit/build-angular to 0.10.7

npm i @angular-devkit/build-angular@0.10.7 --save-dev

@djleonskennedy
Copy link
Author

@igorivaniuk sure? have same issue with 0.10.6

@igorivaniuk
Copy link

@djleonskennedy i use 0.10.7 for now, and all perfectly.


     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 7.1.2
Node: 10.13.0
OS: linux x64
Angular: 7.1.2
... animations, cli, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.10.7
@angular-devkit/build-angular     0.10.7
@angular-devkit/build-optimizer   0.10.7
@angular-devkit/build-webpack     0.10.7
@angular-devkit/core              7.0.7
@angular-devkit/schematics        7.1.2
@angular/cdk                      7.1.1
@angular/flex-layout              7.0.0-beta.19
@angular/material                 7.1.1
@ngtools/webpack                  7.0.7
@schematics/angular               7.1.2
@schematics/update                0.11.2
rxjs                              6.3.3
typescript                        3.1.6
webpack                           4.19.1
Date: 2018-12-11T12:37:27.240Z - Hash: 4d7e5deaa20b9ad72c9e - Time: 109ms
3 unchanged chunks
chunk {main} main.js, main.8977aecd0bb97b10f1a4.hot-update.js (main) 199 kB [initial] [rendered]
chunk {runtime} runtime.js (runtime) 30.9 kB [entry] [rendered]
ℹ 「wdm」: Compiled successfully.
ℹ 「wdm」: Compiling...
                                                                                     
Date: 2018-12-11T12:37:50.575Z - Hash: 00a3ec9ecfa63f5286fe - Time: 107ms
3 unchanged chunks
chunk {main} main.js, main.4d7e5deaa20b9ad72c9e.hot-update.js (main) 199 kB [initial] [rendered]
chunk {runtime} runtime.js (runtime) 30.9 kB [entry] [rendered]
ℹ 「wdm」: Compiled successfully.
ℹ 「wdm」: Compiling...
                                                                                     
Date: 2018-12-11T12:47:48.582Z - Hash: 91cd5715b1a62a6f5c3f - Time: 1736ms
3 unchanged chunks
chunk {main} main.js, main.00a3ec9ecfa63f5286fe.hot-update.js (main) 202 kB [initial] [rendered]
chunk {runtime} runtime.js (runtime) 30.9 kB [entry] [rendered]
ℹ 「wdm」: Compiled successfully.
ℹ 「wdm」: Compiling...
                                                                                     
Date: 2018-12-11T12:48:18.096Z - Hash: 0547970366cf928e0100 - Time: 155ms
3 unchanged chunks
chunk {main} main.js, main.91cd5715b1a62a6f5c3f.hot-update.js (main) 202 kB [initial] [rendered]
chunk {runtime} runtime.js (runtime) 30.9 kB [entry] [rendered]
ℹ 「wdm」: Compiled successfully.
ℹ 「wdm」: Compiling...
                                                                                     
Date: 2018-12-11T12:49:27.900Z - Hash: 3dbe60a6ed940a2ca8bd - Time: 112ms
3 unchanged chunks
chunk {main} main.js, main.0547970366cf928e0100.hot-update.js (main) 202 kB [initial] [rendered]
chunk {runtime} runtime.js (runtime) 30.9 kB [entry] [rendered]
ℹ 「wdm」: Compiled successfully.
ℹ 「wdm」: Compiling...
                                                                                     
Date: 2018-12-11T12:49:58.583Z - Hash: a718ac8b13c6a39d89a9 - Time: 210ms
3 unchanged chunks
chunk {main} main.js, main.3dbe60a6ed940a2ca8bd.hot-update.js (main) 202 kB [initial] [rendered]
chunk {runtime} runtime.js (runtime) 30.9 kB [entry] [rendered]
ℹ 「wdm」: Compiled successfully.

@djleonskennedy
Copy link
Author

@igorivaniuk how big your project ?

@igorivaniuk
Copy link

@djleonskennedy small, about 20 components.

@elvirdolic
Copy link

We have a big project (75k LoC), with "@angular-devkit/build-angular": "~0.11.1", e have recompile time about 20s

with version "@angular-devkit/build-angular": "^0.10.7" it's about 6s

@filipesilva
Copy link
Contributor

Hi all,

I've been looking into this regression in #13102 (comment). At this point I'm very confident that these two issues are the same and it's better if we continue the discussion there.

Please subscribe to that issue for further updates.

Meanwhile, using @angular-devkit/build-angular@0.10.7 is a good workaround for the performance regression.

If you have a medium/large size project it will might help to increase the node memory limit (#5618 (comment)).

@djleonskennedy
Copy link
Author

@filipesilva Seems fixed in 0.12.0, thank you

@moohkooh
Copy link

Hi,

after upgrading our application to angular8, i have similar problems with ng server. In my case ng serve hangs / hold on and nothing happens.

git:(angular8) node --max_old_space_size=4048 ./node_modules/.bin/ng serve es2015 --no-progress --verbose=true --sourceMap=false
AngularCompilerPlugin._setupOptions: 3.813ms
AngularCompilerPlugin._createOrUpdateProgram.ts.createProgram: 5436.932ms
AngularCompilerPlugin._make.resolveEntryModuleFromMain: 14.080ms
AngularCompilerPlugin._listLazyRoutesFromProgram.createProgram: 1.063ms
AngularCompilerPlugin._listLazyRoutesFromProgram.listLazyRoutes: 2900.738ms
AngularCompilerPlugin._emit.ts.getOptionsDiagnostics: 0.154ms
AngularCompilerPlugin._emit.ts.gatherDiagnostics.ts.getSyntacticDiagnostics: 1.151ms

Angular CLI: 8.1.3
Node: 12.7.0
OS: darwin x64
Angular: 8.1.3
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router

Package Version

@angular-devkit/architect 0.801.3
@angular-devkit/build-angular 0.801.3
@angular-devkit/build-optimizer 0.801.3
@angular-devkit/build-webpack 0.801.3
@angular-devkit/core 8.1.3
@angular-devkit/schematics 8.1.3
@angular/cdk 7.3.7
@angular/http 7.2.15
@angular/material 7.3.7
@angular/material-moment-adapter 7.3.7
@ngtools/webpack 8.1.3
@schematics/angular 8.1.3
@schematics/update 0.801.3
rxjs 6.5.2
typescript 3.4.5
webpack 4.35.2

i have no idea how to debug this problem. Our projects include 8 internal library and the main application has ~90k lines of code. Any ideas how to get more information about the process or how to get more verbose information.

Thanks!

@filipesilva
Copy link
Contributor

@moohkooh try @angular-devkit/build-angular@0.802.0-rc.0 with Angular 8.2.0-rc.0 and TypeScript 3.5.3. There were some performance issues addressed in those versions. If that doesn't really work can you open a new issue with a repro please?

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: ngtools/webpack needs: investigation Requires some digging to determine if action is needed severity5: regression
Projects
None yet
Development

No branches or pull requests

10 participants