git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <junio@pobox.com>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: git@vger.kernel.org
Subject: [PATCH 3/3] fetch-pack: use smaller handshake window for initial request
Date: Fri, 18 Mar 2011 15:27:55 -0700	[thread overview]
Message-ID: <7vsjukrrmc.fsf@alter.siamese.dyndns.org> (raw)

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;

             reply	other threads:[~2011-03-18 22:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-18 22:27 Junio C Hamano [this message]
2011-03-20 23:12 ` [PATCH 3/3] fetch-pack: use smaller handshake window for initial request Shawn Pearce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vsjukrrmc.fsf@alter.siamese.dyndns.org \
    --to=junio@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=spearce@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).