Skip to content

Slow build: loadNgStructureAsync takes 73 secs #17879

@vivainio

Description

@vivainio

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Yes, Angular 8 was not blocked here.

Description

  • Enable benchmarking in:

....\node_modules/@ngtools\webpack\src\benchmark.js

(const benchmark = true)

Observe that there is a clear slow phase in the build:


NgccProcessor.processModule.ngcc.process+webpack-sources: 3.247ms
NgccProcessor.processModule.ngcc.process+yargs: 3.237ms
NgccProcessor.processModule.ngcc.process+source-map: 2.713ms
AngularCompilerPlugin._createOrUpdateProgram.ng.createProgram: 13105.799ms
30% building 13/13 modules 0 activeAngularCompilerPlugin._createOrUpdateProgram.ng.loadNgStructureAsync: 73171.067ms   <=== BOOOM
AngularCompilerPlugin._make.resolveEntryModuleFromMain: 21.720ms
AngularCompilerPlugin._listLazyRoutesFromProgram.listLazyRoutes: 77.186ms
AngularCompilerPlugin._emit.ng.getNgStructuralDiagnostics: 0.024ms

🔬 Minimal Reproduction

Not currently. This is our proprietary product.

🌍 Your Environment


Angular CLI: 9.0.7
Node: 10.16.0
OS: win32 x64

Angular: 9.0.7
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router
Ivy Workspace: Yes

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.901.7
@angular-devkit/build-angular      0.901.7
@angular-devkit/build-ng-packagr   0.901.7
@angular-devkit/build-optimizer    0.901.7
@angular-devkit/build-webpack      0.901.7
@angular-devkit/core               9.0.7
@angular-devkit/schematics         9.0.7
@angular/cdk                       9.2.4
@angular/material                  9.2.4
@ngtools/webpack                   9.1.7
@schematics/angular                9.0.7
@schematics/update                 0.900.7
ng-packagr                         9.0.0
rxjs                               6.5.4
typescript                         3.7.5
webpack                            4.42.0

Anything else relevant?

I downgraded to 9.0.7 as hinted by angular/angular#36272. Build time with 9.1.9 was even worse.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions