Skip to content

Initial incremental compilation is slower than expected on large projects #32128

@brandonroberts

Description

@brandonroberts

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

When serving a large project, after the first time saving file changes, the rebuild takes about as long as an initial build. On the subsequent times saving file changes, the rebuild time is much lower.

Initial build -> 46 seconds
Incremental build -> 40 seconds
Incremental build -> 5 seconds

Minimal Reproduction

Repo with new Angular v21 project that contains 50 routes and 10K components.

https://github.com/brandonroberts/angular-large-project

  1. Clone repo, run npm install
  2. Run npm start
  3. Note initial build time
  4. Save a change to one of the pages
  5. Note build time
  6. Save another change
  7. Note the build time

Exception or Error


Your Environment

Angular CLI       : 21.0.3
Angular           : 21.0.5
Node.js           : 22.14.0
Package Manager   : npm 10.9.2
Operating System  : darwin arm64

┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package                   │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/build            │ 21.0.3            │ ^21.0.3           │
│ @angular/cli              │ 21.0.3            │ ^21.0.3           │
│ @angular/common           │ 21.0.5            │ ^21.0.0           │
│ @angular/compiler         │ 21.0.5            │ ^21.0.0           │
│ @angular/compiler-cli     │ 21.0.5            │ ^21.0.0           │
│ @angular/core             │ 21.0.5            │ ^21.0.0           │
│ @angular/forms            │ 21.0.5            │ ^21.0.0           │
│ @angular/platform-browser │ 21.0.5            │ ^21.0.0           │
│ @angular/router           │ 21.0.5            │ ^21.0.0           │
│ rxjs                      │ 7.8.2             │ ~7.8.0            │
│ typescript                │ 5.9.3             │ ~5.9.2            │
│ vitest                    │ 4.0.15            │ ^4.0.8            │

Anything else relevant?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions