summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c07c7bf)
raw | patch | inline | side by side (parent: c07c7bf)
author | Nicolas Pitre <nico@cam.org> | |
Mon, 10 Dec 2007 19:19:32 +0000 (14:19 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 11 Dec 2007 01:10:16 +0000 (17:10 -0800) |
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>
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>
builtin-pack-objects.c | patch | blob | history |
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 250dc56ab5121d3ffda916228ed3dbf71d0def88..7dd0d7f82605798a81e731c8e0db1b5c009e1e08 100644 (file)
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
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;