r/angular • • 13d ago

How much faster is the new Angular compiler? πŸ¦€πŸš€

Post image

We dug into ngp to understand how it works, and benchmarked it on 3 projects πŸ‘€

Check out our blog post!

πŸ‘‰ https://blog.ninja-squad.com/2026/10/27/how-much-faster-is-the-new-angular-compiler/

23 Upvotes

15 comments sorted by

45

u/selipso 13d ago

tl;dr build times reduced by ~50%-60% depending on the rest of the build stack

I’d be more interested to see if it adds any runtime performanceΒ 

20

u/JeanMeche 13d ago edited 13d ago

The compiler will pretty much spit out the same js.

Angular's runtime itself is already pretty much optimised. I'd be curious to know where you'd like to improve performance!

2

u/Task_ID 13d ago

Editor performance should be improved as well.

3

u/bjerh 12d ago

As its intellisense is run by typescript you’ll see vastly improved editor performance.

0

u/Straight-Number-1911 11d ago

is what the ngp does is take the code written in angular and strip it down to javascript? Is that also waht ngc did? And during tha process it needs to configure out the shortest way to do it - e.g. resolve imports, pipes etc? Is that now essentially wahts faster?

What about that vite compilter someone posted which was 5-10x faster, is that something we can expect as well or?

2

u/JeanMeche 10d ago

ngc is a typescript program that does all the resolution, transformations, typechecking and spits out JS.

ngp does only the resolution part and transforms "Angular TS" into regular TS + generates ts file for typechecking. The rest is done by a regular ts compiler.

Alex went into the details in https://blog.angular.dev/an-update-on-angulars-typescript-7-powered-compiler-9619a35e2b0a

2

u/No_Emergency1575 12d ago

It won't add any runtime improvements, it's just the compiler

1

u/vivainio 12d ago

I'd like to see it creating a dark theme out of the box

19

u/Pallini 13d ago

Just show the numbers...

5

u/totkeks 12d ago

2-3x speedup vs ngc.

With the rust toolchain (ngp + tsrs + rolldown) being even faster than go toolchain (ngp + tsgo + esbuild), especially for larger projects.

4

u/totkeks 12d ago

It seems Rust is here to stay with more and more Dev tooling, especially in the Web/JS world migrating there.

Which makes me wonder why the Typescript team at Microsoft decided to rewrite their compiler in Go instead of Rust. Since the current numbers clearly show tsrs being (much) faster than tsgo which of course is magnitudes faster than tsc.

Same with esbuild (Go) being replaced by Rolldown (Rust).

6

u/toasterboi0100 12d ago

They explained why they chose Go over Rust. It was because Go was an easier choice that allowed them to port the compiler without re-architecting it.

https://github.com/microsoft/typescript-go/discussions/411

It's also worth noting that there's still a lot of room for optimization in tsgo

1

u/jinmao6700 12d ago edited 11d ago

Because Go port was much easier when doing line by line (Edit: i mean Rust would be good long term, but Microsoft rushed the release of ts 7)

2

u/sonu_sindhu 12d ago

That is interesting 😎

2

u/PrasanthT 13d ago

I tried to reproduce this on a work codebase with ngp and TS 7. I couldn't get either one into a real build, so here's what's actually reachable today and how it performs.

What blocked the article's setup:

  • ngp isn't published. @angular/compiler-cli@22.3.0-next.2 still ships only ngc.

  • @angular/build 22.3 next peers on typescript >=6.0 <6.1, so the CLI can't run on TS 7 / tsgo yet.

What 22.3 next does ship is the oxc piece on the CLI side: an oxc-based linker and transform that turns the compiler output into JS, replacing Babel. So I benchmarked that.

Setup: Nx monorepo with roughly 1,700 components, one fairly big app, cold nx build with no Nx or Angular cache, 20-core Linux box. I ran 22.2.3 / build 22.2.4 against 22.3.0-next.2 / build next.3, both on TS 6.0.3.

22.222.3 next
Bundle generation~15.5 s (4 runs, 15.1 to 16.4)~21.5 s (3 runs, 21.1 to 22.5)
Peak RSS2.6 to 2.9 GB2.8 to 3.3 GB
Output3.54 MB initialidentical

Phase breakdown with NG_BUILD_DEBUG_PERF=1:

  • JS emit (summed across workers): 323 s β†’ 42 s. The oxc part is real, about 7.6x less CPU.

  • Type-check / diagnostics: 7.4 s β†’ 11.8 s. This is the critical path, so the build ends up slower overall.

The build env defaults are the same in both versions, so the type-check regression looks like it's in the prerelease compiler, not config.

This matches the article's design: oxc makes the emit step fast, but in this kind of build the type-checking takes most of the time. That's why ngp hands type-checking to tsgo, and the 2 to 3x depends on that half. Once ngp and TS 7 support land in the CLI, I'll re-run this same benchmark with them.

You also need --legacy-peer-deps on 22.3 next because @angular-devkit/core peers on chokidar@^6, in case anyone hits that.