Regression in compiler-cli 10.1.0+: build is 10x times slower
See original GitHub issueπ bug report
Affected Package
The issue is caused by package @angular/compiler-cli@10.1.0
Is this a regression?
Yes, the previous version in which this bug was not present was: @angular/compiler-cli@10.0.14
Description
During an attempt to upgrade our repo to Angular 10.1 we noticed that one of our applications is not building anymore. We have investigated and found that one particular component is now taking too much time to compile (10 minutes and more).
It started on @angular/compiler-cli 10.1.0 With this version an app with only one component takes ~3 minutes to compile. With @angular/compiler-cli 10.0.14 the build takes ~20 seconds to complete.
The issue is reproducible with fullTemplateTypeCheck
: true and strictNullChecks
: true.
π¬ Minimal Reproduction
https://github.com/x87/ng10bug
Run yarn build
and observe build time. Then change strictNullChecks
to true
in tsconfig.json
and re-run yarn build
.
π Your Environment
Angular Version:
Angular CLI: 10.1.6
Node: 12.18.2
OS: darwin x64
Angular: 10.1.5
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.1001.6
@angular-devkit/build-angular 0.1001.6
@angular-devkit/build-ng-packagr 0.1001.6
@angular-devkit/core 10.1.6
@angular-devkit/schematics 10.1.6
@angular/cli 10.1.6
@schematics/angular 10.1.6
@schematics/update 0.1001.6
rxjs 6.5.5
typescript 4.0.3
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (9 by maintainers)
Top GitHub Comments
I reported this in microsoft/TypeScript#41124.
Hello folks,
TypeScript 4.1.3 was just released which contains a fix for the cache miss issue when computing type information from the control flow graph. Support for TypeScript 4.1 has been added in Angular 11.1, which is slated to be released in January. Preview builds of 11.1 are available on NPM using the
next
tag, so it is possible to experiment with TS 4.1 today.Iβll close this issue as we wonβt be making changes to Angular to workaround the TS bug (as that would in fact be a performance regression for cases where this bug isnβt hit).