From: bdowning@lavos.net (Brian Downing)
To: Nicolas Pitre <nico@cam.org>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: Preferring shallower deltas on repack
Date: Mon, 9 Jul 2007 14:49:32 -0500 [thread overview]
Message-ID: <20070709194931.GO4087@lavos.net> (raw)
In-Reply-To: <20070709192403.GM4087@lavos.net>
On Mon, Jul 09, 2007 at 02:24:03PM -0500, Brian Downing wrote:
> No, I didn't try it on top of mine; sorry. I'll try that out.
The results with both your patch and mine are exactly the same as
yours applied to master (c956395e). The only thing mine adds on top of
yours is:
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 9a33698..2da78b4 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -1373,6 +1373,12 @@ static int try_delta(struct unpacked *trg, struct unpacke
return 0;
if (trg_entry->delta_data) {
+ /* Prefer only shallower same-sized deltas. */
+ if (delta_size == trg_entry->delta_size &&
+ src_entry->depth + 1 >= trg_entry->depth) {
+ free(delta_buf);
+ return 0;
+ }
delta_cache_size -= trg_entry->delta_size;
free(trg_entry->delta_data);
}
Which was meant to pick off the cases where I got an equivalently
sized patch that was as deep or deeper. This was neccessary due to
my changing:
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -1337,7 +1337,7 @@ static int try_delta(struct unpacked *trg, struct unpacked
if (max_size == 0)
return 0;
if (trg_entry->delta && trg_entry->delta_size <= max_size)
- max_size = trg_entry->delta_size-1;
+ max_size = trg_entry->delta_size;
src_size = src_entry->size;
sizediff = src_size < trg_size ? trg_size - src_size : 0;
if (sizediff >= max_size)
max_size = trg_entry->delta_size;
Your patch changed the max_size selection logic, so I'm not sure the
rest of mine will do anything anymore.
-bcd
next prev parent reply other threads:[~2007-07-09 19:49 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-09 4:43 Preferring shallower deltas on repack Brian Downing
2007-07-09 4:45 ` [PATCH] pack-objects: Prefer shallower deltas if the size is equal Brian Downing
2007-07-09 5:31 ` Preferring shallower deltas on repack Junio C Hamano
2007-07-09 5:43 ` Junio C Hamano
2007-07-09 6:52 ` Brian Downing
2007-07-09 7:27 ` Junio C Hamano
2007-07-09 7:36 ` Brian Downing
2007-07-09 15:58 ` Nicolas Pitre
2007-07-09 16:39 ` Junio C Hamano
2007-07-09 18:53 ` Brian Downing
2007-07-09 19:13 ` Nicolas Pitre
2007-07-09 19:24 ` Brian Downing
2007-07-09 19:49 ` Brian Downing [this message]
2007-07-09 20:22 ` Nicolas Pitre
2007-07-09 20:23 ` Brian Downing
2007-07-09 19:30 ` [PATCH] Shoddy pack information tool Brian Downing
2007-07-11 21:55 ` Junio C Hamano
2007-07-12 3:02 ` [PATCH] Pack " Brian Downing
2007-07-09 5:41 ` Preferring shallower deltas on repack Linus Torvalds
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=20070709194931.GO4087@lavos.net \
--to=bdowning@lavos.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=nico@cam.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).