Closed LorinRenodeyn closed 11 months ago
Can you try generating a new v16 project (ng new myapp --defaults
) and provide the build times with the esbuild-based build system?
Also, I noticed that pnpm was being used. Is the Angular project also using Sass? Unfortunately, there is a module resolution limitation within the Sass compiler that can cause long resolution times when using either pnpm or yarn PnP. Can you also try using npm as the package manager to see if that has an effect?
Tried out switching from PNPM to regular NPM first, that shaved almost 600 seconds off the build time, resulting in 59s for ng serve and 70s for ng build. So that ends up in a ~50% improved compilation time if I can count correctly.
If the impact of the package manager is that dramatic, it should probably be mentioned in the guide and might be worth investigating if there is a possible way to mitigate this?
I'm also facing a similar issue 🤔 not so dramatic but I just compared the previous webpack
build for our app with the current esbuild
from 16.1.1
. Is this a know issue ? I mean the build time was never great and I hopped that it will be better with this change but going to a new tool which makes it slower is never desired 🤔 . Does anyone know why that might be ?
Build Time esbuild on my machine: Cold startup: 120s Rebuilds: 6-12s Build Time webpack on my machine: Cold startup: 102s Rebuilds: 3-6s
Machine specs:
Angular CLI: 16.1.3
Node: 16.18.1
Package Manager: npm 8.19.2
OS: darwin arm64
Angular: 16.1.3
... animations, cdk, cli, common, compiler, compiler-cli, core
... elements, forms, google-maps, language-service, material
... platform-browser, platform-browser-dynamic, platform-server
... router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1601.3
@angular-devkit/build-angular 16.1.3
@angular-devkit/core 16.1.3
@angular-devkit/schematics 16.1.3
@nguniversal/builders 16.1.1
@nguniversal/express-engine 16.1.1
@schematics/angular 16.1.3
rxjs 7.5.7
typescript 5.0.4
webpack 5.86.0
We're experiencing the same problem. We thought it would be only related to our project because there was nothing similar to find in the web. And we'd never thought that it would be related to pnpm.
Is there any hope that there will be a fix for this in a timely manner? Otherwise we would have to think about migrating away from pnpm.
Same here. Angular 16 (with es-build and vite), storybook 7. For me it's 150s - 200s for bootstrap, 50s-60s for each change, about the same as if not worst than what I had before es-build / vite...
Same here. I am surprised this was not noticed before the release? If it was, it should of been fixed before the release.
Esbuild is still described as a feature to try out and explicitly not production ready at the guide page for it.
But if there was a known difference between package managers it should have been mentioned in the guide. In any case it needs to be added to the current list of known issues now.
@LorinRenodeyn There is a pending PR to update the docs angular/angular#51006 !
We are using 16.1.5 and Pnpm with Tailwind, and ESBuild.
Even for a very small project, rebuilds are 12 seconds consistently, while it used to be less than a second. Not sure what's going on
Edit: reverting to the old build: rebuilds are now 1 second, so 12x faster. I assume this is the Sass/EsBuild @import/@use issue. Will have to stick to the old builder until this is somehow resolved. :(
Edit2: I'm also using pnpm so that's probably the reason.. oh well
Edit3: NG16.2 seems to have resolved the issues
We are using 16.1.5 and Pnpm with Tailwind, and ESBuild.
Even for a very small project, rebuilds are 12 seconds consistently, while it used to be less than a second. Not sure what's going on
Edit: reverting to the old build: rebuilds are now 1 second, so 12x faster. I assume this is the Sass/EsBuild @import/@use issue. Will have to stick to the old builder until this is somehow resolved. :(
Edit2: I'm also using pnpm so that's probably the reason.. oh well
Can you try switching to npm or yarn for a test? I tried on my projects and it made a really big diff.
@spock123 You should see improvements with the 16.2 !
There are several perfs improvement shipped with #25548 and #25534 !
@JeanMeche Yes it's much much better in 16.2!! Now I just need i18n support but that's another matter /s
@eneajaho Yes npm/yarn were much faster but I have to use pnpm as the app is part of a large monorepo with 10+ apps.
Cheers
hey, does anyone experience slower build times than they were in angular 15 using webpack? we've got 2x times slower builds by just migrating from angular 15 to 16
Closing as this specific issue should be addressed with improvements in 16.2. If you are still seeing performance issues, please try the latest v17 prereleases which have a significant amount of improvements over 16.x.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
Command
build, serve
Is this a regression?
The previous version in which this bug was not present was
No response
Description
Wit the advent of Angular 16 I figured I'd give the esbuild builder another try after it not providing much benefit for my project with Angular 15 and initially not working with angular-material back then.
Fully on v16, the esbuild does run. However, instead of faster it is extremely slow compared to the default builder.
I'm talking 658s for
ng-serve --proxy-config proxy.config.json
vs 119831ms with the default builderAnd 694s for
ng build -c=production --subresource-integrity
vs 149683ms with the default builderAt the moment, I'm in the dark as to what could be causing this issue. The only possible hunch would be the iban commonjs module?
Minimal Reproduction
The only things I have changed were in the configuration: adding the
-esbuild
suffix to the specified builder and importing the material icons font via the styles array instead of via an scss file.Package JSON:
angular.json
Exception or Error
No response
Your Environment
Anything else relevant?
I am working on a Windows VDI via Citrix as mandated by the client, which is considerably slower than my own machine. However, the difference is nowhere near big enough to explan a 650+ second ng-serve command.
Package manager is PNPM
My app is split up in
Packages that may be relevant: