Skip to content

Commit e8d5b62

Browse files
committed
small update in getThreadsCount
1 parent be6439b commit e8d5b62

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
@@ -29,7 +29,8 @@ const getThreadsCount = () => {
2929

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

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

0 commit comments

Comments
 (0)