public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Jonathan Nieder <jrnieder@gmail•com>
Cc: Jonathan Tan <jonathantanmy@google•com>,
	git@vger•kernel.org, Stefan Beller <sbeller@google•com>
Subject: Re: [PATCH] fetch-pack: grow stateless RPC windows exponentially
Date: Mon, 18 Jul 2016 13:00:41 -0700	[thread overview]
Message-ID: <xmqqoa5uiumu.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20160718193147.GC29326@google.com> (Jonathan Nieder's message of "Mon, 18 Jul 2016 12:31:47 -0700")

Jonathan Nieder <jrnieder@gmail•com> writes:

> You have full control of the growth function.  So how about aggressive
> growth until 1024*10?
>
> That is:
>
> Current git:
>   n < 1024: aggressive exponential
> 	16, 32, 64, 128, 256, 512, 1024
>   1024 <= n: linear
> 	2048, 3072, 4096, 5120, ...
>
> Initial proposal:
>   n < 1024: aggressive exponential
> 	16, 32, 64, 128, 256, 512, 1024
>   1024 <= n < 10240: linear
> 	2048, 307, 4096, 5120, ...
>   10240 <= n: conservative exponential
> 	11264, 12390, ...
>
> New proposal:
>   n < 10240: aggressive exponential
> 	16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384
>   10240 <= n: conservative exponential
> 	18022, 19824, ...
>
> That way, on one hand it would still never use a smaller window than
> today and on the other hand the heuristic would be easier to
> understand (only decelarating, instead of decelarating and then
> accelerating again).

That sounds more explainable (I do not know if that is a growth
curve that gives us better results, though).

So, the result would look something like this, perhaps?

 fetch-pack.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/fetch-pack.c b/fetch-pack.c
index 3c5dfc4..97fe5f7 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -264,12 +264,17 @@ static void insert_one_alternate_ref(const struct ref *ref, void *unused)
 
 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 * 10)
+			count <<= 1;
+		else
+			count = count * 11 / 10;
+	} else {
+		if (count < PIPESAFE_FLUSH)
+			count <<= 1;
+		else
+			count += PIPESAFE_FLUSH;
+	}
 	return count;
 }
 

  reply	other threads:[~2016-07-18 20:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-18 18:36 [PATCH] fetch-pack: grow stateless RPC windows exponentially Jonathan Tan
2016-07-18 18:55 ` Jonathan Nieder
2016-07-18 19:10   ` Junio C Hamano
2016-07-18 19:16     ` Jonathan Tan
2016-07-18 19:31       ` Jonathan Nieder
2016-07-18 20:00         ` Junio C Hamano [this message]
2016-07-18 21:05           ` Jonathan Tan
2016-07-18 21:36             ` Junio C Hamano
2016-07-18 22:21               ` [PATCH v2] " Jonathan Tan
2016-07-18 22:40                 ` Jonathan Nieder
2016-07-19 16:46                 ` Stefan Beller
2016-07-19 19:03                   ` Jonathan Tan
2016-07-19 19:17                     ` Stefan Beller
2016-07-19 19:23                     ` Junio C Hamano
2016-07-19 19:53                       ` Jonathan Nieder
2016-07-19 20:20                         ` Junio C Hamano
2016-07-20 13:40                         ` Jeff King

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=xmqqoa5uiumu.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=jonathantanmy@google$(echo .)com \
    --cc=jrnieder@gmail$(echo .)com \
    --cc=sbeller@google$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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