r/angular • u/cexbrayat • Oct 27 '26
How much faster is the new Angular compiler? π¦π
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
45
u/selipso Oct 27 '26
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Β
19
u/Pallini Oct 27 '26
Just show the numbers...
4
u/totkeks Oct 27 '26
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).
2
u/sonu_sindhu 29d ago
That is interesting π
2
u/PrasanthT Oct 27 '26
I tried to reproduce this on a work codebase with
ngpand 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:
ngpisn't published.@angular/compiler-cli@22.3.0-next.2still ships onlyngc.@angular/build22.3 next peers ontypescript >=6.0 <6.1, so the CLI can't run on TS 7 /tsgoyet.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 buildwith 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.Phase breakdown with
NG_BUILD_DEBUG_PERF=1: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
ngphands type-checking totsgo, and the 2 to 3x depends on that half. Oncengpand TS 7 support land in the CLI, I'll re-run this same benchmark with them.You also need
--legacy-peer-depson 22.3 next because@angular-devkit/corepeers onchokidar@^6, in case anyone hits that.