From: Nicolas Pitre <nico@cam.org>
To: Shawn Pearce <spearce@spearce.org>
Cc: Junio C Hamano <junkio@cox.net>, git@vger.kernel.org
Subject: Re: 1.3.0 creating bigger packs than 1.2.3
Date: Thu, 20 Apr 2006 22:28:40 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0604202213470.2215@localhost.localdomain> (raw)
In-Reply-To: <20060421012029.GB819@spearce.org>
On Thu, 20 Apr 2006, Shawn Pearce wrote:
> Based on Linus' comment I changed your patch to just the following.
> It still produced the 46M pack file, so the first hunk apears to
> not have had much of an affect with this data.
>
> From a running time perspective it appears as though this patch is
> making things slightly better, not worse. I ran it a few times
> for each case always using the 46M pack as input for
> "git-repack -a -d -f".
>
> 'next' 137.13 real 95.82 user 25.24 sys
> 'next'+patch 131.62 real 89.35 user 28.56 sys
>
> but even if the running time was an extra 6 seconds I'd still rather
> spend 4% more running time to use 1/2 the storage space.
>
>
> diff --git a/pack-objects.c b/pack-objects.c
> index 09f4f2c..f7d6217 100644
> --- a/pack-objects.c
> +++ b/pack-objects.c
> @@ -1052,7 +1052,7 @@ static int try_delta(struct unpacked *cu
> if (cur_entry->delta)
> max_size = cur_entry->delta_size-1;
> if (sizediff >= max_size)
> - return -1;
> + return 0;
> delta_buf = diff_delta(old->data, oldsize,
> cur->data, size, &delta_size, max_size);
> if (!delta_buf)
I can confirm this is indeed the best fix so far. Any "smarter"
solution I could think of did increase the size of the final pack quite
spectacularly and rather unexpectedly with Shawn's repository.
Of course removing the if (sizediff >= max_size) entirely does produce a
smaller pack (39MB) but it takes about twice the CPU.
With the patch above the Linux kernel pack is 0.3% smaller with 1% more
CPU usage. But like for the diff-delta hash list limiting code this
small overhead is certainly a good compromize to avoid big degradations
in some other cases.
Nicolas
next prev parent reply other threads:[~2006-04-21 2:32 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-20 13:36 1.3.0 creating bigger packs than 1.2.3 Shawn Pearce
2006-04-20 14:47 ` Linus Torvalds
2006-04-20 15:03 ` Shawn Pearce
2006-04-20 16:07 ` Linus Torvalds
2006-04-20 16:43 ` Shawn Pearce
2006-04-20 17:03 ` Linus Torvalds
2006-04-20 17:24 ` Junio C Hamano
2006-04-20 17:31 ` Shawn Pearce
2006-04-20 17:54 ` Nicolas Pitre
2006-04-20 21:31 ` Junio C Hamano
2006-04-20 21:53 ` Shawn Pearce
2006-04-20 21:56 ` Jakub Narebski
2006-04-20 17:41 ` Nicolas Pitre
2006-04-20 17:55 ` Shawn Pearce
2006-04-20 18:24 ` Nicolas Pitre
2006-04-20 18:49 ` Junio C Hamano
2006-04-20 21:02 ` Nicolas Pitre
2006-04-20 21:40 ` Junio C Hamano
2006-04-20 22:02 ` Shawn Pearce
2006-04-20 22:35 ` Junio C Hamano
2006-04-21 1:01 ` Shawn Pearce
2006-04-20 22:59 ` Linus Torvalds
2006-04-21 0:52 ` Nicolas Pitre
2006-04-21 1:20 ` Shawn Pearce
2006-04-21 2:28 ` Nicolas Pitre [this message]
2006-04-21 2:40 ` Shawn Pearce
2006-04-21 3:07 ` Nicolas Pitre
2006-04-21 2:32 ` Shawn Pearce
2006-04-20 23:02 ` Junio C Hamano
2006-04-20 16:09 ` 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=Pine.LNX.4.64.0604202213470.2215@localhost.localdomain \
--to=nico@cam.org \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=spearce@spearce.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).