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
This commit is contained in:
commit
67b3a5d4c0
19
fetch-pack.c
19
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user