Skip to content

Commit 164c0d8

Browse files
committed
fix(@angular-devkit/build-angular): reduce the number of max workers to available CPUs minus one
This commit reduces the maximum number of workers to the available CPUs minus 1. This adjustment ensures that some resources are left for the main thread, preventing it from being starved of CPU cycles.
1 parent 0a22e05 commit 164c0d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/angular_devkit/build_angular/src/utils/environment-options.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export const allowMinify = debugOptimize.minify;
7878
const maxWorkersVariable = process.env['NG_BUILD_MAX_WORKERS'];
7979
export const maxWorkers = isPresent(maxWorkersVariable)
8080
? +maxWorkersVariable
81-
: Math.min(4, availableParallelism());
81+
: Math.min(4, Math.max(availableParallelism() - 1, 1));
8282

8383
const parallelTsVariable = process.env['NG_BUILD_PARALLEL_TS'];
8484
export const useParallelTs = !isPresent(parallelTsVariable) || !isDisabled(parallelTsVariable);

0 commit comments

Comments
 (0)