-
Notifications
You must be signed in to change notification settings - Fork 12k
Improve production build times #9295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
aa70fcd
to
5abec4f
Compare
436808c
to
26de777
Compare
@filipesilva |
Also since we're adding a cache could we see some RAM benchmarks? |
Using the number of cpu cores would probably be a good idea. Too many threads will end up hurting performance due to excessive context switching and too little will limit the potential performance improvement. |
Since according to the readme there's diminishing returns after 4, I think something like this would be best
|
Most likely because the tests were run on a quad core system which would make 4 the best number to use. Especially since the readme says performance started to really suffer after 8. |
@clydin Possibly, I think it would be worth doing our own analysis either way since this could be a big factor on the final speed |
26de777
to
42f58c9
Compare
I tried adding the CPU config to the same that
Then I ran cleared node_modules and ran 2 prod builds in a row:
I also tried a new project:
Doesn't seem a big difference overall. But I think making it variable it might be worth it for some environments with less than 3 CPUs to avoid spawning more threads than needed, but probably defaulting to 1 if there's just one CPU. PR is amended accordingly. |
42f58c9
to
8b9d3a5
Compare
117409a
to
12ec358
Compare
I removed the parallelization to reduce risk since it looks like cache is what provided the bigger benefit. |
12ec358
to
f0ba0a4
Compare
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This PR adds cache support for UglifyJS and Build Optimizer, and executes Build Optimizer in parallel.
Benchmarks for
ng build --prod
: