summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorKimiyuki Onaka <kimiyuki@google.com>2020-08-28 10:05:27 +0900
committerMike Frysinger <vapier@google.com>2020-09-09 03:52:24 +0000
commit0501b29e7ae072e0b10ea9ddd913ec6d5975f690 (patch)
tree95cc04852cbebe2365d0667c865c3995780fdda7 /project.py
parent4e1fc1013c9203d3f5e7bdfba909d175a522c1f3 (diff)
downloadgit-repo-0501b29e7ae072e0b10ea9ddd913ec6d5975f690.tar.gz
status: Use multiprocessing for `repo status -j<num>` 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 <kimiyuki@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'project.py')
-rw-r--r--project.py7
1 files changed, 7 insertions, 0 deletions
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):
3208 self._bare = bare 3208 self._bare = bare
3209 self._gitdir = gitdir 3209 self._gitdir = gitdir
3210 3210
3211 # __getstate__ and __setstate__ are required for pickling because __getattr__ exists.
3212 def __getstate__(self):
3213 return (self._project, self._bare, self._gitdir)
3214
3215 def __setstate__(self, state):
3216 self._project, self._bare, self._gitdir = state
3217
3211 def LsOthers(self): 3218 def LsOthers(self):
3212 p = GitCommand(self._project, 3219 p = GitCommand(self._project,
3213 ['ls-files', 3220 ['ls-files',