-
Notifications
You must be signed in to change notification settings - Fork 27.3k
AOT Dev builds in Angular v9+ are much slower than JIT #37293
Copy link
Copy link
Closed
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: compilerIssues related to `ngc`, Angular's template compilerIssues related to `ngc`, Angular's template compilerarea: performanceIssues related to performanceIssues related to performancestate: confirmedtype: bug/fix
Milestone
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: compilerIssues related to `ngc`, Angular's template compilerIssues related to `ngc`, Angular's template compilerarea: performanceIssues related to performanceIssues related to performancestate: confirmedtype: bug/fix
Type
Fields
Give feedbackNo fields configured for issues without a type.
🐞 Bug report
Command (mark with an
x)Is this a regression?
Yes, not present in 8.2.
Description
Dev builds in Angular 9 are very slow. Builds of 8.2 took on average 30 seconds or so, and recompiles took 2-5 seconds. This same app in Angular 9, however, takes ~45-60 seconds to build initially, and recompiles take ~15-25 seconds even if nothing changes at all. Production builds are roughly 5-10 seconds faster in 9, so those are better at least. (Note that none of these times include
ngcc, that's taken care of before I attempt to build.) Additionally, the speed is slow regardless of whether Ivy is used or not.The Angular 9 build always seems to freeze for a bit at a certain point. It frequently lists the same file, but it's not always the same file that it seems to get stuck on. There's nothing special about the file it usually lists, it's actually quite small and has no advanced Angular or TypeScript features.
I found #34699 (and #33532 by extension), but those are unrelated. I'm using TS 3.8 and it happens regardless of the value of that option in
tsconfig.json.Is there a way I can audit what's causing it to take so long? I tried
ng build --watch --verbose, but it provides way more information than I can feasibly parse (and also doesn't include timings from what I can tell).🔬 Minimal Reproduction
This repo has a reproduction. Instructions are in the readme.
🔥 Exception or Error
N/A
🌍 Your Environment
Anything else relevant?
N/A