From b2fa30a2b891b22c173c960a67bf38ccbba8de1b Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 24 Feb 2021 00:15:32 -0500 Subject: sync: switch network fetch to multiprocessing This avoids GIL limitations with using threads for parallel processing. This reworks the fetch logic to return results for processing in the main thread instead of leaving every thread to do its own processing. We have to tweak the chunking logic a little here because multiprocessing favors batching over returning immediate results when using a larger value for chunksize. When a single job can be quite slow, this tradeoff is not good UX. Bug: https://crbug.com/gerrit/12389 Change-Id: I0f0512d15ad7332d1eb28aff52c29d378acc9e1d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/298642 Reviewed-by: Chris Mcdonald Tested-by: Mike Frysinger --- progress.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'progress.py') diff --git a/progress.py b/progress.py index ae797488..de46f538 100644 --- a/progress.py +++ b/progress.py @@ -42,12 +42,12 @@ def duration_str(total): class Progress(object): - def __init__(self, title, total=0, units='', print_newline=False): + def __init__(self, title, total=0, units='', print_newline=False, delay=True): self._title = title self._total = total self._done = 0 self._start = time() - self._show = False + self._show = not delay self._units = units self._print_newline = print_newline # Only show the active jobs section if we run more than one in parallel. -- cgit v1.2.3-54-g00ecf