summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorJosip Sokcevic <sokcevic@chromium.org>2024-10-07 17:33:38 +0000
committerLUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2024-10-07 18:44:19 +0000
commit454fdaf1191c87e5c770ab865a911e10e600e178 (patch)
treea20af3e4f05b48f28d30346648ab9fa1be7f4f64 /project.py
parentf7f9dd4deb3b92bf175a0411dac60e7b6fdd9cfa (diff)
downloadgit-repo-454fdaf1191c87e5c770ab865a911e10e600e178.tar.gz
sync: Always use WORKER_BATCH_SIZEv2.48
With 551285fa35ccd0836513e9cf64ee8d3372e5e3f4, the comment about number of workers no longer stands - dict is shared among multiprocesses and real time information is available. Using 2.7k projects as the baseline, using chunk size of 4 takes close to 5 minutes. A chunk size of 32 takes this down to 40s - a reduction of rougly 8 times which matches the increase. R=gavinmak@google.com Bug: b/371638995 Change-Id: Ida5fd8f7abc44b3b82c02aa0f7f7ae01dff5eb07 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/438523 Commit-Queue: Josip Sokcevic <sokcevic@google.com> Tested-by: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com>
Diffstat (limited to 'project.py')
-rw-r--r--project.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/project.py b/project.py
index 88dd747b..1d8ab556 100644
--- a/project.py
+++ b/project.py
@@ -2396,26 +2396,25 @@ class Project:
2396 try: 2396 try:
2397 # if revision (sha or tag) is not present then following function 2397 # if revision (sha or tag) is not present then following function
2398 # throws an error. 2398 # throws an error.
2399 revs = [f"{self.revisionExpr}^0"]
2400 upstream_rev = None
2401 if self.upstream:
2402 upstream_rev = self.GetRemote().ToLocal(self.upstream)
2403 revs.append(upstream_rev)
2404
2399 self.bare_git.rev_list( 2405 self.bare_git.rev_list(
2400 "-1", 2406 "-1",
2401 "--missing=allow-any", 2407 "--missing=allow-any",
2402 "%s^0" % self.revisionExpr, 2408 *revs,
2403 "--", 2409 "--",
2404 log_as_error=False, 2410 log_as_error=False,
2405 ) 2411 )
2412
2406 if self.upstream: 2413 if self.upstream:
2407 rev = self.GetRemote().ToLocal(self.upstream)
2408 self.bare_git.rev_list(
2409 "-1",
2410 "--missing=allow-any",
2411 "%s^0" % rev,
2412 "--",
2413 log_as_error=False,
2414 )
2415 self.bare_git.merge_base( 2414 self.bare_git.merge_base(
2416 "--is-ancestor", 2415 "--is-ancestor",
2417 self.revisionExpr, 2416 self.revisionExpr,
2418 rev, 2417 upstream_rev,
2419 log_as_error=False, 2418 log_as_error=False,
2420 ) 2419 )
2421 return True 2420 return True