-
Notifications
You must be signed in to change notification settings - Fork 12k
Compile time is painfully slow #24922
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
You certainly could! The linker is just a Babel plugin that can be incorporated into any build pipeline. |
What are your build times? Did you try using the experimental esbuild based builder?
Have you profiled the build to verify the type-checking is the culprit here? |
Build times are about 30 seconds on first build. Esbuild doesn't seem to make much of a difference. I've profiled my build running It's hard to interpret exactly why it's slow, all I know is that it's slow. And It's not a simple stack to interpret, I have no idea how to answer your question even with the profiles. |
Those are profiles from a production build, right? |
nope, development. our default build is our development build |
or do you mean a production build of angular-cli? If so then yes, v15.1.5 |
whoops! our ng build and ng serve are configured a little differently for their defaults, I forgot. Here is it properly optimizaed for development, which is closer to the actual speed of build on an M1 Mac (~18 seconds): Config:
attached result So not 30 seconds, about 18. This to me is still uncomfortably slow, both on boot up and waiting from 4 up to another 15 seconds each update is punishing. where is the bottleneck to you in the latest cpuprofile I have? |
Do you have profiles of incremental compilations, not the initial one after startup? The first and second build are known to be more expensive; only after the second rebuild can incremental type-checking be used due to some technicalities with how template type-checking works. So I'm interested in profiles of rebuilds after the second one, ideally with a no-op change (e.g. introducing a |
Is there any intent or initiative to improve the speed of the first two builds? I do them often enough that it’s far from ideal. Esbuild had a small but insubstantial effect, is there intent to optimise further? |
Not that I'm aware of at the moment. There's ideas like angular/angular#43131 and angular/angular#43165 that are relevant here. |
It would be good for this to be higher on the list of priorities. So much value is lost in waiting during those precious seconds, it breaks flow. |
@JoostK thanks for your patience, I've dug a little deeper and will give more information now. It's clear that the esbuilder produces a much faster output and it's the way forward. Unfortunately, while 24 seconds is much faster than 64, two problems exist with esbuild:
without esbuild enabled: CPU.20230331.113255.80503.0.001.cpuprofile.zip - 64 seconds with esbuild enabled CPU.20230331.114951.81858.0.001.cpuprofile.zip - 24 seconds @clydin as you were working on adding esbuild, may you have some insight here? |
Support for The esbuild profile is as expected to me. The main difference in why the CLI with esbuild isn't nearly as fast as bare esbuild is that the TypeScript compiler is still used to parse + type-check + emit modules, given that the AOT compiler is built on top of TypeScript. esbuild is only used for bundling/optimization purposes. |
Oh that’s great timing, didn’t see it. I’m glad that it looks like it’s getting attention anyway. its the only thing about Angular Im not a fan of, I’ve been using it since the v1 days and love where it’s heading… thanks for your time |
closing and tracking #24923 |
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. |
Command
build, serve
Description
The ng build/serve compilation times of angular dwarf any other bundler/framework I know of and this is a real drag on my team's development time.
I am wondering if there is perhaps a way to just disable type checking or other things that may be large contributing factors to build time, or some sort of alternative being explored?
Can you also explain a little bit about what % the bottlenecks are right now? It would be good to understand things a little better.
Describe the solution you'd like
A way faster compilation time
Describe alternatives you've considered
There aren't any, because since the linker change in Angular 13, I can't use a 3rd party bundler anymore.
The text was updated successfully, but these errors were encountered: