Commit dc20764a37894e042fc3f8be9c5e413fe2521873

Stefan Sperling 2021-10-15T09:30:29

limit delta chain length in newly created pack files to 32 deltas Our former limit was 128 which is fairly high. Git uses 50 by default. A smaller limit results in slightly larger pack files but makes both packing and unpacking faster.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/pack_create.c b/lib/pack_create.c
index 953b2e8..6bcae58 100644
--- a/lib/pack_create.c
+++ b/lib/pack_create.c
@@ -221,7 +221,7 @@ pick_deltas(struct got_pack_meta **meta, int nmeta, int nours,
 			}
 			base = meta[j];
 			/* long chains make unpacking slow, avoid such bases */
-			if (base->nchain >= 128 ||
+			if (base->nchain >= 32 ||
 			    base->obj_type != m->obj_type)
 				continue;