git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/3] fetch-pack: use smaller handshake window for initial request
@ 2011-03-18 22:27 Junio C Hamano
  2011-03-20 23:12 ` Shawn Pearce
  0 siblings, 1 reply; 2+ messages in thread
From: Junio C Hamano @ 2011-03-18 22:27 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: git

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 <junio@pobox.com>
---
 builtin/fetch-pack.c |    6 ++++--
 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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-20 23:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-18 22:27 [PATCH 3/3] fetch-pack: use smaller handshake window for initial request Junio C Hamano
2011-03-20 23:12 ` Shawn Pearce

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).