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 <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nicolas Pitre committed
Dec 10, 2007 at 14:19 UTC
eb9688ff65a3f7fb28ee6488be728fc72e42d5d6
1 file changed
+10
builtin-pack-objects.c
+10
@@ -1709,6 +1709,16 @@ static void ll_find_deltas(struct object_entry **list, unsigned list_size,
1709
list++;
1710
sub_size--;
1711
}
1712
+ if (!sub_size) {
1713
+ /*
1714
+ * It is possible for some "paths" to have
1715
+ * so many objects that no hash boundary
1716
+ * might be found. Let's just steal the
1717
+ * exact half in that case.
1718
+ */
1719
+ sub_size = victim->remaining / 2;
1720
+ list -= sub_size;
1721
+ }
1722
target->list = list;
1723
victim->list_size -= sub_size;
1724
victim->remaining -= sub_size;