git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] fetch-pack: grow stateless RPC windows exponentially

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 18, 2016, 20:00 UTC
Message-ID
<xmqqoa5uiumu.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20160718193147.GC29326@google.com>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 29 quoted lines
> 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;
 }
 
Previous: Jonathan NiederNext: Jonathan Tan
Message 6 of 17 in “fetch-pack: grow stateless RPC windows exponentially”
  1. fetch-pack: grow stateless RPC windows exponentiallyJonathan Tan, Jul 18, 2016
  2. Jonathan NiederJul 18, 2016
  3. Junio C HamanoJul 18, 2016
  4. Jonathan TanJul 18, 2016
  5. Jonathan NiederJul 18, 2016
  6. Junio C HamanoJul 18, 2016
  7. Jonathan TanJul 18, 2016
  8. Junio C HamanoJul 18, 2016
  9. fetch-pack: grow stateless RPC windows exponentiallyJonathan Tan, Jul 18, 2016
  10. Jonathan NiederJul 18, 2016
  11. Stefan BellerJul 19, 2016
  12. Jonathan TanJul 19, 2016
  13. Stefan BellerJul 19, 2016
  14. Junio C HamanoJul 19, 2016
  15. Jonathan NiederJul 19, 2016
  16. Junio C HamanoJul 19, 2016
  17. Jeff KingJul 20, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.