All of lore.kernel.org
 help / color / mirror / Atom feed
From: bdowning@lavos.net (Brian Downing)
To: Nicolas Pitre <nico@cam.org>
Cc: Junio C Hamano <junkio@cox.net>, git@vger.kernel.org
Subject: Re: [PATCH] apply delta depth bias to already deltified objects
Date: Thu, 12 Jul 2007 10:20:16 -0500	[thread overview]
Message-ID: <20070712152016.GB19073@lavos.net> (raw)
In-Reply-To: <alpine.LFD.0.999.0707120049120.32552@xanadu.home>

On Thu, Jul 12, 2007 at 02:38:30AM -0400, Nicolas Pitre wrote:
> This apparently makes BRian's patological case worse (although better 
> than before his same-size-shallower patch), but I think that the 
> improvement in the general case is worth it.  Even Brian's pack gets 
> smaller so...

I've found why this makes my case worse, and I think it's correctable
and will benefit everything when fixed:

Let's say we've currently got a delta match of 11 bytes at depth 5.
So trg_entry->delta_size = 11 and trg_entry->depth = 5.  max_depth is
100.

Now let's say the next object we're comparing against is at depth 2
(src_entry->depth = 2).  Even if we can find a delta of the same size
we should take it.

Now, with Nico's new patch:

		max_size = trg_entry->delta_size * max_depth /
				(max_depth - trg_entry->depth + 1);

max_size is now 11.  So far so good.

Now, however, the other bias happens:

	max_size = max_size * (max_depth - src_entry->depth) / max_depth;

    max_size = 11 * (100 - 2) / 100;
    max_size = 1078 / 100;
    max_size = 10;

This was okay when max_size was always (trg_size/2 - 20) here, but now
it's cutting it off too much.  max_size is now 10, and we can't make
a better depth match of the same size anymore.

I think the second bias equation should be scaled so as not to take
effect unless (src_entry->depth [+ 1?] > trg_entry->depth).

Other than this flaw I think this patch looks great.

-bcd

  reply	other threads:[~2007-07-12 15:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-12  6:38 [PATCH] apply delta depth bias to already deltified objects Nicolas Pitre
2007-07-12 15:20 ` Brian Downing [this message]
2007-07-12 16:27   ` Nicolas Pitre
2007-07-12 16:44     ` Brian Downing
2007-07-12 18:07       ` Nicolas Pitre
2007-07-12 18:33 ` Nicolas Pitre

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=20070712152016.GB19073@lavos.net \
    --to=bdowning@lavos.net \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.