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

[PATCH] relax delta selection filtering in pack-objects

From
Nicolas Pitre <nico@cam.org>
Date
Feb 22, 2006, 01:39 UTC
Message-ID
<Pine.LNX.4.64.0602212034180.5606@localhost.localdomain>

This change provides a 8% saving on the pack size with a 4% CPU time increase for git-repack -a on the current git archive.

Signed-off-by: Nicolas Pitre <nico@cam.org>
---
 pack-objects.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
2aed7126f9b44d9ef953e8a1cbeab34356410842
diff --git a/pack-objects.c b/pack-objects.c
index ceb107f..4f8814d 100644
--- a/pack-objects.c
+++ b/pack-objects.c
@@ -748,11 +748,10 @@ static int try_delta(struct unpacked *cu
 	}
 
 	size = cur_entry->size;
-	if (size < 50)
-		return -1;
 	oldsize = old_entry->size;
 	sizediff = oldsize > size ? oldsize - size : size - oldsize;
-	if (sizediff > size / 8)
+
+	if (size < 50)
 		return -1;
 	if (old_entry->depth >= max_depth)
 		return 0;
-- 
1.2.2.g6643-dirty
Next: Junio C Hamano
Message 1 of 4 in “relax delta selection filtering in pack-objects”
  1. relax delta selection filtering in pack-objectsNicolas Pitre, Feb 22, 2006
  2. Junio C HamanoFeb 22, 2006
  3. Junio C HamanoFeb 22, 2006
  4. Nicolas PitreFeb 22, 2006

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.