Skip to content

incremental rebuilds with "application" builder are 2-3 times slower #27280

Closed
@dmitry-stepanenko

Description

@dmitry-stepanenko

Command

serve

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

esbuild shows much better build/start time, but appears to fall behind significantly when it comes to incremental rebuilds.

From my observations, saved component takes 2-3 times longer to rebuild while serving in comparison to webpack-based builder.

Minimal Reproduction

I've created a repo that allows to reproduce the problem https://github.com/dmitry-stepanenko/angular-esbuild-vs-webpack

It contains 2 targets in "architect" section of angular.json: build (esbuild application builder) and wpbuild (webpack browser builder). Simply rename the one you need into build to test it.

Then try to save some of the files in the repository to see the difference.

Personal observations for simple changes in components (no new imports, only console.logs or html elements added/removed):

esbuild application builder
build 34,7s

src/app/app0/lib2/childlib0/src/lib/lib2childlib0component0/lib2childlib0component0.component.ts - 16,9s
src/app/app0/lib2/childlib0/src/lib/lib2childlib0component0/lib2childlib0component0.component.html 12.6
src/app/app0/lib2/childlib0/src/lib/childlib0.module.ts - 13.8s
revert changes - 14,7s
src/app/app0/lib2/childlib0/src/lib/lib2childlib0component0/lib2childlib0component0.component.ts - 12.3s
src/app/app0/lib2/childlib0/src/lib/lib2childlib0component0/lib2childlib0component0.component.ts - 13.7s
src/app/app0/lib2/childlib0/src/lib/lib2childlib0component0/lib2childlib0component0.component.html - 11.5s
src/app/app0/lib2/childlib0/src/lib/lib2childlib0component0/lib2childlib0component0.component.html - 11.9s

webpack browser builder
build 156s

src/app/app0/lib2/childlib0/src/lib/lib2childlib0component0/lib2childlib0component0.component.ts - 6,2s
src/app/app0/lib2/childlib0/src/lib/lib2childlib0component0/lib2childlib0component0.component.html 2,9s
src/app/app0/lib2/childlib0/src/lib/childlib0.module.ts - 9s
revert changes - 3,4s
src/app/app0/lib2/childlib0/src/lib/lib2childlib0component0/lib2childlib0component0.component.ts - 2,7s
src/app/app0/lib2/childlib0/src/lib/lib2childlib0component0/lib2childlib0component0.component.ts - 2,73s
src/app/app0/lib2/childlib0/src/lib/lib2childlib0component0/lib2childlib0component0.component.html - 2,3s
src/app/app0/lib2/childlib0/src/lib/lib2childlib0component0/lib2childlib0component0.component.html - 2,2s

Exception or Error

No response

Your Environment

Angular CLI: 17.3.0
Node: 18.19.0
Package Manager: npm 10.2.3
OS: darwin x64

Angular: 17.3.0
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1703.0
@angular-devkit/build-angular   17.3.0
@angular-devkit/core            17.3.0
@angular-devkit/schematics      17.3.0
@schematics/angular             17.3.0
rxjs                            7.8.1
typescript                      5.4.2
zone.js                         0.14.4

Anything else relevant?

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions