-
Notifications
You must be signed in to change notification settings - Fork 155
Build Optimizer increasing build time excessively #305
Comments
Thanks @filipesilva. I will have a test tonight and get back to you ASAP. |
Only around 2 minutes difference now !Thanks for your hard work @filipesilva. |
All credit goes to @clydin, he's the one working on reducing Build Optimizer run time and memory usage. |
Hi i am also having this issue but am not using angular-cli, any recomendations what i can do to make my build work with build-optimizer turned on. In my case it gets to around 50% then hangs forever |
@caroline-church is your project open source or available for me to see somewhere? |
@filipesilva here is my branch https://github.com/caroline-church/fabric-composer/tree/improve-performance-2. Its a mono-repo so you have to run npm install in the top level directory. The package you want to look at is composer-playground. If you run |
Hi everyone! This hangs forever (it is not a memory problem, uses around 400Mb) but keeps consuming CPU and do not finish. This other one, disabling the build optimizer, works: One particularity on the ng project is that it contains one big/medium file (a generated parser) of 108 Kb in size and this looks to be the hanging point. Versions used:
The project is not open source, cannot share it as is. But I can prepare a private repro sample if requested. |
@pjmolina that's pretty interesting, the big file. Is the file itself something you can share? |
@filipesilva Yes, in a private way (not for public disclosure). |
@filipesilva I just created a shared full repro sample. |
I ran some tests disabling each individual optimization that Build Optimizer does and the culprit seems to be https://github.com/angular/devkit/blob/master/packages/angular_devkit/build_optimizer/src/transforms/prefix-classes.ts. We're probably doing something horribly inefficient there and it takes a long time on big files. |
Just in case, if the TypeScript compiler/lib is involved, as an hypothesis: Could it be related to this other bug: TypeScript #17033 I reported on the TS compiler? |
Unsure... but something odd is happening here. I tried using the node inspector to get a CPU profile, and... it crashes. I set a breakpoint right before Build Optimizer starts processing I might be related to that TS issue yes. Build Optimizer processes input files as JS files with So yeah, I think it boils down to microsoft/TypeScript#17033. |
Did a quick test with PR #346 and a production build ( |
I think #346 is a great improvement, but worry about the sourcemap limitation. It means there are situations where having sourcemaps in production might mean extremely lengthy build. But that's the case now anyways. |
This issue was moved to angular/angular-cli#12153 |
In angular/angular-cli#5618 (comment), @changLiuUNSW reported a 3x increase in build time (from ~3 to ~9 minutes) when using
--build-optimizer
:Angular CLI 1.5.2 with Angular 5.0.1
#304 has possibly improved this, but needs to be verified.
@changLiuUNSW can you try with Angular CLI 1.5.5 and let us know what's the current build time please?
Likely related to #240.
The text was updated successfully, but these errors were encountered: