diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-08-03 15:10:27 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-08-03 15:10:27 -0700 |
commit | 67b3a5d4c084c3f579205a07b65169e742d39c02 (patch) | |
tree | 501242a51b6a4c92fd044dccb05aa14018a9598c /fetch-pack.c | |
parent | Merge branch 'jk/git-jump' (diff) | |
parent | fetch-pack: grow stateless RPC windows exponentially (diff) | |
download | tgif-67b3a5d4c084c3f579205a07b65169e742d39c02.tar.xz |
Merge branch 'jt/fetch-large-handshake-window-on-http'
"git fetch" exchanges batched have/ack messages between the sender
and the receiver, initially doubling every time and then falling
back to enlarge the window size linearly. The "smart http"
transport, being an half-duplex protocol, outgrows the preset limit
too quickly and becomes inefficient when interacting with a large
repository. The internal mechanism learned to grow the window size
more aggressively when working with the "smart http" transport.
* jt/fetch-large-handshake-window-on-http:
fetch-pack: grow stateless RPC windows exponentially
Diffstat (limited to 'fetch-pack.c')
-rw-r--r-- | fetch-pack.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/fetch-pack.c b/fetch-pack.c index b501d5c320..85e77af61d 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -243,16 +243,21 @@ static void insert_one_alternate_ref(const struct ref *ref, void *unused) #define INITIAL_FLUSH 16 #define PIPESAFE_FLUSH 32 -#define LARGE_FLUSH 1024 +#define LARGE_FLUSH 16384 static int next_flush(struct fetch_pack_args *args, int count) { - int flush_limit = args->stateless_rpc ? LARGE_FLUSH : PIPESAFE_FLUSH; - - if (count < flush_limit) - count <<= 1; - else - count += flush_limit; + if (args->stateless_rpc) { + if (count < LARGE_FLUSH) + count <<= 1; + else + count = count * 11 / 10; + } else { + if (count < PIPESAFE_FLUSH) + count <<= 1; + else + count += PIPESAFE_FLUSH; + } return count; } |