From 61d28b3283728b466beb9d5ba6f3d3a8151750cb Mon Sep 17 00:00:00 2001 From: Collin Anderson Date: Thu, 21 Oct 2021 14:57:32 -0400 Subject: [PATCH] Increase batches per worker to 16 --- src/flake8/checker.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/flake8/checker.py b/src/flake8/checker.py index d008b98..c53634b 100644 --- a/src/flake8/checker.py +++ b/src/flake8/checker.py @@ -677,12 +677,13 @@ def calculate_pool_chunksize(num_checkers, num_jobs): """Determine the chunksize for the multiprocessing Pool. - For chunksize, see: https://docs.python.org/3/library/multiprocessing.html#multiprocessing.pool.Pool.imap # noqa - - This formula, while not perfect, aims to give each worker two batches of + - This formula, while not perfect, aims to give each worker 16 batches of work. - See: https://github.com/pycqa/flake8/issues/829#note_18878876 - See: https://github.com/pycqa/flake8/issues/197 + - See: https://github.com/pycqa/flake8/issues/1430 """ - return max(num_checkers // (num_jobs * 2), 1) + return max(num_checkers // (num_jobs * 16), 1) def _run_checks(checker):