Skip to content

Commit 5c862d7

Browse files
committed
Limit default number of eval threads to 32
Scalability bottlenecks currently cause diminishing returns above this. It also prevents creating huge numbers of threads on machines with lots of cores.
1 parent aa8f61b commit 5c862d7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/libexpr/parallel-eval.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ thread_local bool Executor::amWorkerThread{false};
1717

1818
unsigned int Executor::getEvalCores(const EvalSettings & evalSettings)
1919
{
20+
/* Note: the default number of cores is currently limited to 32
21+
due to scalability bottlenecks. */
2022
return evalSettings.evalProfilerMode != EvalProfilerMode::disabled ? 1
21-
: evalSettings.evalCores == 0UL ? Settings::getDefaultCores()
23+
: evalSettings.evalCores == 0UL ? std::min(32U, Settings::getDefaultCores())
2224
: evalSettings.evalCores;
2325
}
2426

0 commit comments

Comments
 (0)