-
Notifications
You must be signed in to change notification settings - Fork 12k
After upgrading to Angular 8 , compile time increased 3 times. #14604
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
Comments
Duplicate of #14554? |
@trotyl, not really |
@alialtun14, can you provide some more info, such as which command are you using is it a Would you be able to provide a reproduction please? |
We used static:true in ViewChild. @ViewChild(Hplan_edt, {static:true}) vEdt: Hplan_edt "ngs": "node --max_old_space_size=4096 node_modules/@angular/cli/bin/ng" Date: 2019-05-30T23:13:42.637Z |
Do you use npm i fibers --save-dev Run the build and report the timings npm i node-sass -save-dev Thanks Run the build and report the timings. |
@alan-agius4 Thank you for your attention and effort. I have compiled again after doing the operations you said. The result has not changed. The compile process is waiting for about half an hour while 25%. The same project takes less than 40 seconds to compile with ng serve instead of ng build --prod --aot. I have been working on upgrading to angular 8 for two days. The project actually does not have too much dependency, which may be likely to be the problem. There are only hammerjs and quill. I think I'll use angular 7.2 for a temporary solution. |
After convert to angular 7.2.15, I compile the project with node 12 environment . Then I installed the node 10.16.0 for angular 7.2.15 and the compile time is 901.372ms (normal) Node: 12.3.1 + Angular: 7.2.15Angular CLI: 7.3.9 OS: win32 x64 webpack: 4.29.0 TS: 3.2.4
Node: 10.16.0 + Angular: 7.2.15(Angular CLI: 7.3.9 OS: win32 x64 webpack: 4.29.0 TS: 3.2.4
Node: 12.3.1 + Angular 8.0
|
Hi @alialtun14, from what you provided above, it's seems that it is slower on Node 12 irrispective of the Angular CLI version, if anything version 8 is much faster than version 7 on Node 12. This will require some digging to determine why the build is faster on Node 10 compared to Node 12. I couldn't help but notice that for version 7 the compilation takes less than 1 second which doesn't seem to be right. Would you be able to share your application please? |
angular 7.2.15 project code without any error. to convert the project to angular 8, the is only two term in the project.
|
Hi @alialtun14, Thanks for the reproduction, we'll try to take a close look soon. In the meantime I am going to close this issue in favor of #13734 so that we have this issue tracked in a single tread. Thanks for understanding. |
I'm upgrading an application from Angular 7 to 8 and I'm also facing a huge impact in the compilation time, but I don't think it is related to #13734 (I don't see any error messages and everything works fine). The application is relatively complex (51 chunks total). The compilation process percentage reaches the 100% and then it starts again from 0%. I'm not using Time to build:
I've then revert to Angular 7.2 and I get these values:
|
Same problem here too... |
Overall angular-cli is two times slower and consumes more memory than custom script with rollup or closure and even webpack. CI times are much worse. |
It seems it has been improved in @angular/cli 8.0.3 according to #14746. |
Hi all, I faced the same problem too, even in the 8.0.3 version. In my case, going back to native Sass (explained here https://update.angular.io/#7.0:8.0) fix the problem (I now have the same compilation time than with Angular 7). For me, the JS compiler seems to be extremely slow with sass files. |
Upgrading to cli 8.0.3:
Upgrading to cli 8.0.3 and using node-sass:
|
Upgrading to cli 8.0.4:
Upgrading to cli 8.0.4 and using node-sass:
|
Sorry but: The issue is open and not closed ! |
I'm seriously working with the new compiler. I assume your "doesn't-say-anything" error is something miss-configured or any kind of issue during the upgrading on your side. I don't think this error belongs to this issue: we are talking about compilation time here. |
Yes and the compilation time in angular 8 is toooooooo slow! |
It is actually faster than in Angular 7. The difference is that Angular 8 provides Differential Loading out-of-the-box. In my case, it was compiling two different versions, one for es5 and other one for es2015, doubling the compilation process. |
I would like to thank everyone who helped solve the problem. Today we have launched the application compiled with angular 8. |
How do you disable this? |
You have two choices:
Complete guide is provided by official Angular docs: https://angular.io/guide/deployment#configuring-differential-loading More info: https://stackoverflow.com/questions/56197896/how-to-turn-off-differential-loading-in-angular-v8 Hope this help. |
There is a new Angular 8 feature called differential loading. To support differential loading, Angular 8 would build two bundles of JavaScript files, one set to support modern browers, the other set to support legacy browsers. Hence, it takes at least twice the build time as before. In Angular 7, there used to have a setting in angular.json file, which specifies whether support es5 browsers or not. angular.json
However, in Angular 8 this setting is deprecated. Instead, you have to configure browserslist file to tell Angular build which browsers are supported. By default, browserslist looks like below: browserslist
If you only care about Edge, Firefox and Chrome, drop 0.5% and last 2 versions, one will include very old browsers, the other will include all of the mobile browsers. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I upgraded my project to Angular 8 version. While upgrading process, I haven't met any error. But the compile time increased 3 times without any error.
tsconfig.json
package.josn
The text was updated successfully, but these errors were encountered: