From 0501b29e7ae072e0b10ea9ddd913ec6d5975f690 Mon Sep 17 00:00:00 2001 From: Kimiyuki Onaka Date: Fri, 28 Aug 2020 10:05:27 +0900 Subject: status: Use multiprocessing for `repo status -j` instead of threading This change increases the speed of the command with parallelization with processes. The parallelization with threads doesn't work well, and increasing the number of jobs to many (8 threads ~) didn't increase the speed. Possibly, the global interpreter lock of Python affects. Bug: https://crbug.com/gerrit/12389 Change-Id: Icbe5df8ba037dd91422b96f4e43708068d7be924 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/279936 Tested-by: Kimiyuki Onaka Reviewed-by: Mike Frysinger --- project.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'project.py') diff --git a/project.py b/project.py index 972cfa5f..fdbf9e4a 100644 --- a/project.py +++ b/project.py @@ -3208,6 +3208,13 @@ class Project(object): self._bare = bare self._gitdir = gitdir + # __getstate__ and __setstate__ are required for pickling because __getattr__ exists. + def __getstate__(self): + return (self._project, self._bare, self._gitdir) + + def __setstate__(self, state): + self._project, self._bare, self._gitdir = state + def LsOthers(self): p = GitCommand(self._project, ['ls-files', -- cgit v1.2.3-54-g00ecf