summaryrefslogtreecommitdiff
path: root/builtin/fetch-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-03-21 04:52:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-03-21 04:53:30 (GMT)
commit066bf4c2e43c7fb40405843e49f809431314865d (patch)
treeb6d4c1f00603f9f9de0810b825b90a04d543a33a /builtin/fetch-pack.c
parent6afca450c3f2f05385900a7b8d3a0d47286f983f (diff)
downloadgit-066bf4c2e43c7fb40405843e49f809431314865d.zip
git-066bf4c2e43c7fb40405843e49f809431314865d.tar.gz
git-066bf4c2e43c7fb40405843e49f809431314865d.tar.bz2
fetch-pack: use smaller handshake window for initial request
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>
Diffstat (limited to 'builtin/fetch-pack.c')
-rw-r--r--builtin/fetch-pack.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
index b4f34a2..3c2c940 100644
--- a/builtin/fetch-pack.c
+++ b/builtin/fetch-pack.c
@@ -218,12 +218,14 @@ static void send_request(int fd, struct strbuf *buf)
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;