Skip to content

Commit cb6b356

Browse files
Merge pull request #84081 from charles-zablit/charles-zablit/update-checkout/set-max-thread-limit-to-64
[update-checkout] lower the default number of parallel processes
2 parents 7fe655d + cebbb34 commit cb6b356

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

utils/update_checkout/update_checkout/parallel_runner.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,13 @@ def __init__(
4646
pool_args: List[Union[RunnerArguments, AdditionalSwiftSourcesArguments]],
4747
n_processes: int = 0,
4848
):
49-
self._monitor_polling_period = 0.1
5049
if n_processes == 0:
51-
n_processes = cpu_count() * 2
52-
self._terminal_width = shutil.get_terminal_size().columns
50+
# Limit the number of processes as the performance regresses after
51+
# if the number is too high.
52+
n_processes = min(cpu_count() * 2, 16)
5353
self._n_processes = n_processes
54+
self._monitor_polling_period = 0.1
55+
self._terminal_width = shutil.get_terminal_size().columns
5456
self._pool_args = pool_args
5557
self._fn = fn
5658
self._pool = Pool(processes=self._n_processes)

0 commit comments

Comments
 (0)