{"thread":{"id":"3429","subject":"[PATCH] relax delta selection filtering in pack-objects","startedAt":"2006-02-22T01:39:25Z","lastAt":"2006-02-22T16:04:21Z","messageCount":4,"participants":["Nicolas Pitre","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"16551","messageId":"Pine.LNX.4.64.0602212034180.5606@localhost.localdomain","threadId":"3429","inReplyTo":null,"subject":"[PATCH] relax delta selection filtering in pack-objects","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2006-02-22T01:39:25Z","receivedAt":"2006-02-22T01:39:25Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"\nThis change provides a 8% saving on the pack size with a 4% CPU time \nincrease for git-repack -a on the current git archive.\n\nSigned-off-by: Nicolas Pitre <nico@cam.org>\n\n---\n\n pack-objects.c |    5 ++---\n 1 files changed, 2 insertions(+), 3 deletions(-)\n\n2aed7126f9b44d9ef953e8a1cbeab34356410842\ndiff --git a/pack-objects.c b/pack-objects.c\nindex ceb107f..4f8814d 100644\n--- a/pack-objects.c\n+++ b/pack-objects.c\n@@ -748,11 +748,10 @@ static int try_delta(struct unpacked *cu\n \t}\n \n \tsize = cur_entry->size;\n-\tif (size < 50)\n-\t\treturn -1;\n \toldsize = old_entry->size;\n \tsizediff = oldsize > size ? oldsize - size : size - oldsize;\n-\tif (sizediff > size / 8)\n+\n+\tif (size < 50)\n \t\treturn -1;\n \tif (old_entry->depth >= max_depth)\n \t\treturn 0;\n-- \n1.2.2.g6643-dirty\n"},{"id":"16563","messageId":"7vpslgrkr0.fsf@assigned-by-dhcp.cox.net","threadId":"3429","inReplyTo":"Pine.LNX.4.64.0602212034180.5606@localhost.localdomain","subject":"Re: [PATCH] relax delta selection filtering in pack-objects","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-02-22T06:05:39Z","receivedAt":"2006-02-22T06:05:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I haven't dug into the issue yet, but these four delta series\nseem to break the testsuite.\n"},{"id":"16564","messageId":"7vhd6rsvqd.fsf@assigned-by-dhcp.cox.net","threadId":"3429","inReplyTo":"7vpslgrkr0.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] relax delta selection filtering in pack-objects","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-02-22T07:23:06Z","receivedAt":"2006-02-22T07:23:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n> I haven't dug into the issue yet, but these four delta series\n> seem to break the testsuite.\n\nI bisected.  It is the adler32 one -- since it makes the\ngenerated delta much smaller, it is understandable that it would\ninteract with the break/rename heuristics.  It is not strictly\nbreakage in that sense -- we just need to readjust the\nheuristics thresholds for those algorithms.\n"},{"id":"16570","messageId":"Pine.LNX.4.64.0602221058320.5606@localhost.localdomain","threadId":"3429","inReplyTo":"7vhd6rsvqd.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] relax delta selection filtering in pack-objects","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2006-02-22T16:04:21Z","receivedAt":"2006-02-22T16:04:21Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Tue, 21 Feb 2006, Junio C Hamano wrote:\n\n> Junio C Hamano <junkio@cox.net> writes:\n> \n> > I haven't dug into the issue yet, but these four delta series\n> > seem to break the testsuite.\n> \n> I bisected.  It is the adler32 one -- since it makes the\n> generated delta much smaller, it is understandable that it would\n> interact with the break/rename heuristics.  It is not strictly\n> breakage in that sense -- we just need to readjust the\n> heuristics thresholds for those algorithms.\n\nI had a quick look and that code rather looks like black magic to me atm.\nI however found a memory leak in diffcore-rename.c:estimate_similarity():\n\n        delta = diff_delta(src->data, src->size,\n                           dst->data, dst->size,\n                           &delta_size, delta_limit);\n        if (!delta)\n                /* If delta_limit is exceeded, we have too much differences */\n                return 0;\n\n        /* A delta that has a lot of literal additions would have\n         * big delta_size no matter what else it does.\n         */\n        if (base_size * (MAX_SCORE-minimum_score) < delta_size * MAX_SCORE)\n                return 0;\n                   \\________ delta memory is leaked.\n\n\nNicolas\n"}]}