Skip to content

Commit 1872bdc

Browse files
committed
small update in getThreadsCount
1 parent cb148a9 commit 1872bdc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/cubejs-schema-compiler/src/compiler/DataSchemaCompiler.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ const getThreadsCount = () => {
3030

3131
const cpuCount = os.cpus()?.length;
3232
if (cpuCount) {
33-
return Math.max(1, cpuCount - 1);
33+
// there's no practical boost above 5 threads even if you have more cores.
34+
return Math.min(Math.max(1, cpuCount - 1), 5);
3435
}
3536

3637
return 3; // Default (like the workerpool do)

0 commit comments

Comments
 (0)