From: Junio C Hamano Date: Mon, 21 Mar 2011 04:52:45 +0000 (-0700) Subject: fetch-pack: use smaller handshake window for initial request X-Git-Tag: v1.7.5-rc0~5^2~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=066bf4c2e43c7fb40405843e49f809431314865d;p=git.git 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 Acked-by: Shawn Pearce --- diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index b4f34a2cf..3c2c9406c 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;