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

Re: [PATCH] simple euristic for further free packing improvements

From
Nicolas Pitre <nico@cam.org>
Date
May 16, 2006, 02:53 UTC
Message-ID
<Pine.LNX.4.64.0605152237240.18071@localhost.localdomain>
In-Reply-To
<7v4pzqhh3t.fsf@assigned-by-dhcp.cox.net>
On Mon, 15 May 2006, Junio C Hamano wrote:
Show 26 quoted lines
> Nicolas Pitre <nico@cam.org> writes:
> 
> > @@ -1038,8 +1038,8 @@ static int try_delta(struct unpacked *tr
> >  
> >  	/* Now some size filtering euristics. */
> >  	size = trg_entry->size;
> > -	max_size = size / 2 - 20;
> > -	if (trg_entry->delta)
> > +	max_size = (size/2 - 20) / (src_entry->depth + 1);
> > +	if (trg_entry->delta && trg_entry->delta_size <= max_size)
> >  		max_size = trg_entry->delta_size-1;
> >  	src_size = src_entry->size;
> >  	sizediff = src_size < size ? size - src_size : 0;
> 
> At the first glance, this seems rather too agressive.  It makes
> me wonder if it is a good balance to penalize the second
> generation base by requiring it to produce a small delta that is
> at most half as we normally would (and the third generation a
> third), or maybe the penalty should kick in more gradually, like
> e.g. ((max_depth * 2 - src_entry->depth) / (max_depth * 2).
> 
> Having said that, judging from your past patches, I learned to
> trust that you have tried tweaking this part and settled on this
> simplicity and elegance, so I'll take the patch as is -- if
> somebody wants to play with it that can always be done to
> further improve things.

Actually I didn't play with that part that much. The only thing I tried besides this version was (size - 20) / (src_entry->depth + 1) but it produced larger packs than the current version.

So I thought it was better to provide a simple initial rule and leave possible improvements for later.

Nicolas
Previous: Junio C HamanoNext: Nicolas Pitre
Message 4 of 6 in “pack-object mystery explained”
  1. Nicolas PitreMay 15, 2006
  2. simple euristic for further free packing improvementsNicolas Pitre, May 15, 2006
  3. Junio C HamanoMay 16, 2006
  4. Nicolas PitreMay 16, 2006
  5. improve depth heuristic for maximum delta sizeNicolas Pitre, May 16, 2006
  6. Junio C HamanoMay 16, 2006

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.