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

Re: thin packs ending up fat

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 13, 2012, 00:14 UTC
Message-ID
<7vboq81msn.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20120112223234.GA4949@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 17 quoted lines
> Hmm. It turns out this is really easy, because we have already marked
> such objects as preferred bases.
>
> So with this patch:
>
> diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
> index 96c1680..d05e228 100644
> --- a/builtin/pack-objects.c
> +++ b/builtin/pack-objects.c
> @@ -1439,6 +1439,7 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,
>  	 */
>  	if (reuse_delta && trg_entry->in_pack &&
>  	    trg_entry->in_pack == src_entry->in_pack &&
> +	    !src_entry->preferred_base &&
>  	    trg_entry->in_pack_type != OBJ_REF_DELTA &&
>  	    trg_entry->in_pack_type != OBJ_OFS_DELTA)
>  		return 0;

Yeah, I was wondering why this one-liner was not in the original message ;-)

Show 12 quoted lines
> here are the numbers I get:
>
>                   dataset
>             | fetches | tags
> ---------------------------------
>      before | 53358   | 2750977
> size  after | 32398   | 2668479
>      change |   -39%  |      -3%
> ---------------------------------
>      before |  0.18   | 1.12
> CPU   after |  0.18   | 1.15
>      change |    +0%  |      +3%
Looks good.
Previous: Nicolas PitreNext: Junio C Hamano
Message 4 of 12 in “thin packs ending up fat”
  1. Jeff KingJan 12, 2012
  2. Jeff KingJan 12, 2012
  3. Nicolas PitreJan 12, 2012
  4. Junio C HamanoJan 13, 2012
  5. Junio C HamanoJan 13, 2012
  6. Jeff KingJan 13, 2012
  7. Jeff KingJan 13, 2012
  8. Junio C HamanoJan 13, 2012
  9. Jeff KingJan 13, 2012
  10. Nicolas PitreJan 13, 2012
  11. Ævar Arnfjörð BjarmasonJan 13, 2012
  12. Jeff KingJan 13, 2012

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.