From: Nicolas Pitre Date: Mon, 10 Dec 2007 19:19:32 +0000 (-0500) Subject: pack-objects: more threaded load balancing fix with often changed paths X-Git-Tag: v1.5.4-rc0~24 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=eb9688ff65a3f7fb28ee6488be728fc72e42d5d6;p=git.git pack-objects: more threaded load balancing fix with often changed paths The code that splits the object list amongst work threads tries to do so on "path" boundaries not to prevent good delta matches. However, in some cases, a few paths may largely dominate the hash distribution and it is not possible to have good load balancing without ignoring those boundaries. Signed-off-by: Nicolas Pitre Signed-off-by: Junio C Hamano --- diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c index 250dc56ab..7dd0d7f82 100644 --- a/builtin-pack-objects.c +++ b/builtin-pack-objects.c @@ -1709,6 +1709,16 @@ static void ll_find_deltas(struct object_entry **list, unsigned list_size, list++; sub_size--; } + if (!sub_size) { + /* + * It is possible for some "paths" to have + * so many objects that no hash boundary + * might be found. Let's just steal the + * exact half in that case. + */ + sub_size = victim->remaining / 2; + list -= sub_size; + } target->list = list; victim->list_size -= sub_size; victim->remaining -= sub_size;