-
Notifications
You must be signed in to change notification settings - Fork 12k
Upgrading from v9 to v11 ng build/serve are very slow #20227
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
@MathewBerg, can you please share the project privately? |
Thanks @alan-agius4. While the upload is happening is there a command I can run that shows me timings and may help me diagnose? |
Running the build with the environment variable If you could provide the contents of the application's tsconfig that would be helpful as well. |
@clydin thanks for the response, I'll try running with that env var. All the styles for our app are .scss Here's the tsconfig (paths removed, there are 14)
|
@clydin I ran |
@alan-agius4 I'm not sure I'll be able share the code actually. |
Does updating to v10 result in the performance issue as well? |
@clydin that will take a bit of time for me to try. |
It may be related but @angular-devkit/build-angular 0.1100.7 is the latest version on my machine compiling project in reasonable time. Any newer version cause rebuild time approx. 5 times higher. So I simply usign downgraded angular-devkit/build-angular with latest other modules and all seems to be ok.
and let know if does it help |
Angular 11.2.5 has some significant compilation performance improvements. I think that they are mostly targeted at |
@MathewBerg, In #20235 there was a lot of valuable information provided which was paramount to land a number of fixes in Angular CLI which would be available in 11.2.5 which should be released later on this week. You can try to use the snapshot builds to verify the impact of these changes https://github.com/angular/angular-devkit-build-angular-builds Rebuild times are also heavily effected by the
NB: Replace my-project-name with your application project name |
@Splaktar going to the latest angular helped somewhat, the build times for ng serve are a little more reasonable but still higher. I did try doing the upgrade path to 10 but there are errors that are presented so I think that might be fruitless. @alan-agius4 thanks for the information! I will try that and eagerly await cli to hit 11.2.5. We have 34 files in our assets folder, but I will try running with showCircularDependencies set to false. |
are you sure it will be in 11.2.5? based on changelog + NPM , 11.2.5 was released 10.3.2021 I guess it will be in 11.2.6+ then |
@montella1507 angular is at 11.2.5 but the angular cli is still on 11.2.4: https://www.npmjs.com/package/@angular/cli |
Ah so, thank you. |
@MathewBerg, can you kindly update to the latest Angular and Angular CLI latest versions and see if the problem persists? You can use the below command to update:
Thanks. |
@alan-agius4 doing that as we speak. |
@alan-agius4 some updates. Yes that helped, still a little slow. I've been spending the past week or so removing some circular dependencies as we may attempt to move to NX which doesn't like them either. That got another large chunk of time out. A11 now builds in a "reasonable" amount of time although still slower then before we may be able to roll with it. The last thing is the asset problem you mentioned. In #20244 there's a mention of adding resolutions, so I'll try that. Thanks for all your help, I'll close this for now and follow that other one. |
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. |
🐞 Bug report
Command (mark with an
x
)Description
We were unable to upgrade from angular 9 to 11 last year. After doing the migration the builds are taking around an hour and ng serve is taking around 10minutes to start and then a few minutes to recompile.
🔬 Minimal Reproduction
The project is quite large. I may be able to share it on my private github if necessary.
🔥 Exception or Error
I saw this issue raised: #17557 that was able to spit out the webpack timings but I tried the same command and didn't get anything. Here are some logs from that command though:
Hash: 10062e72e655a942dd34
Version: webpack 4.44.2
Time: 708716ms
Built at: 03/09/2021 10:15:12 AM
LOG from webpack.buildChunkGraph.visitModules
prepare: 157.7756ms
visiting: 11.9087ms
calculating available modules: 0.9064ms
merging available modules: 0.1087ms
visiting: 47.7026ms
calculating available modules: 1.9921ms
merging available modules: 0.023ms
visiting: 1.39ms
Initial Chunk Files | Names | Size
main-es5.3ac0413d5fda208dcf49.js | main | 3.60 MB
main-es2015.3ac0413d5fda208dcf49.js | main | 3.32 MB
polyfills-es5.1577f06bbd7cd498d2aa.js | polyfills-es5 | 131.77 kB
styles.088de8f15a462993e614.css | styles | 108.92 kB
polyfills-es2015.603bb5ba1ae3ee6b7388.js | polyfills | 45.98 kB
runtime-es2015.12e587ff0e65ab518ba8.js | runtime | 3.40 kB
runtime-es5.12e587ff0e65ab518ba8.js | runtime | 3.40 kB
🌍 Your Environment
Anything else relevant?
The text was updated successfully, but these errors were encountered: