summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6afca45)
raw | patch | inline | side by side (parent: 6afca45)
author | Junio C Hamano <gitster@pobox.com> | |
Mon, 21 Mar 2011 04:52:45 +0000 (21:52 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 21 Mar 2011 04:53:30 +0000 (21:53 -0700) |
Start the initial request small by halving the INITIAL_FLUSH (we will try
to stay one window ahead of the server, so we would end up giving twice as
many "have" in flight at the very beginning). We may want to tweak these
values even more, taking MTU into account.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Shawn Pearce <spearce@spearce.org>
to stay one window ahead of the server, so we would end up giving twice as
many "have" in flight at the very beginning). We may want to tweak these
values even more, taking MTU into account.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Shawn Pearce <spearce@spearce.org>
builtin/fetch-pack.c | patch | blob | history |
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
index b4f34a2cf93a8e0579ea183b644f558807df47e5..3c2c9406c499102138495638d98797886855c073 100644 (file)
--- a/builtin/fetch-pack.c
+++ b/builtin/fetch-pack.c
safe_write(fd, buf->buf, buf->len);
}
-#define INITIAL_FLUSH 32
+#define INITIAL_FLUSH 16
#define LARGE_FLUSH 1024
static int next_flush(int count)
{
- if (count < LARGE_FLUSH)
+ if (count < INITIAL_FLUSH * 2)
+ count += INITIAL_FLUSH;
+ else if (count < LARGE_FLUSH)
count <<= 1;
else
count += LARGE_FLUSH;