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

Re: [PATCH] pack-objects: reuse data from existing pack.

From
Nicolas Pitre <nico@cam.org>
Date
Feb 16, 2006, 03:41 UTC
Message-ID
<Pine.LNX.4.64.0602152226130.5606@localhost.localdomain>
In-Reply-To
<7vbqx8m62q.fsf@assigned-by-dhcp.cox.net>
On Wed, 15 Feb 2006, Junio C Hamano wrote:
Show 11 quoted lines
> When generating a new pack, notice if we have already the wanted
> object in existing packs.  If the object has a delitified
> representation, and its base object is also what we are going to
> pack, then reuse the existing deltified representation
> unconditionally, bypassing all the expensive find_deltas() and
> try_deltas() routines.
> 
> Also, when writing out such deltified representation and
> undeltified representation, if a matching data already exists in
> an existing pack, just write it out without uncompressing &
> recompressing.
Great !
Show 39 quoted lines
> Without this patch:
> 
>     $ git-rev-list --objects v1.0.0 >RL
>     $ time git-pack-objects p <RL
> 
>     Generating pack...
>     Done counting 12233 objects.
>     Packing 12233 objects....................
>     60a88b3979df41e22d1edc3967095e897f720192
> 
>     real    0m32.751s
>     user    0m27.090s
>     sys     0m2.750s
> 
> With this patch:
> 
>     $ git-rev-list --objects v1.0.0 >RL
>     $ time ../git.junio/git-pack-objects q <RL
> 
>     Generating pack...
>     Done counting 12233 objects.
>     Packing 12233 objects.....................
>     60a88b3979df41e22d1edc3967095e897f720192
>     Total 12233, written 12233, reused 12177
> 
>     real    0m4.007s
>     user    0m3.360s
>     sys     0m0.090s
> 
> Signed-off-by: Junio C Hamano <junkio@cox.net>
> 
> ---
> 
>  * This may depend on one cleanup patch I have not sent out, but
>    I am so excited that I could not help sending this out first.
> 
>    Admittedly this is hot off the press, I have not had enough
>    time to beat this too hard, but the resulting pack from the
>    above passed unpack-objects, index-pack and verify-pack.

In fact, the resulting pack should be identical with or without this patch, shouldn't it?

FYI: I have list of patches to produce even smaller (yet still 
compatible) packs, or less dense ones but with much reduced CPU usage.  
All depending on a new --speed argument to git-pack-objects.  I've been 
able to produce 15-20% smaller packs with the same depth and window 
size, but taking twice as much CPU time to produce. Combined with your 
patch, one could repack the object store with the maximum compression 
even if it is expensive CPU wise, but any pull will benefit from it 
afterwards with no additional cost.

I only need to find some time to finally clean and re-test those patches...

Nicolas
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 17 in “[FYI] pack idx format”
  1. Junio C HamanoFeb 15, 2006
  2. Johannes SchindelinFeb 15, 2006
  3. Nicolas PitreFeb 15, 2006
  4. Junio C HamanoFeb 16, 2006
  5. pack-objects: reuse data from existing pack.Junio C Hamano, Feb 16, 2006
  6. packed objects: minor cleanupJunio C Hamano, Feb 16, 2006
  7. Nicolas PitreFeb 16, 2006
  8. Junio C HamanoFeb 16, 2006
  9. Linus TorvaldsFeb 16, 2006
  10. Junio C HamanoFeb 16, 2006
  11. Andreas EricssonFeb 16, 2006
  12. Junio C HamanoFeb 16, 2006
  13. Junio C HamanoFeb 17, 2006
  14. pack-objects: finishing touches.Junio C Hamano, Feb 17, 2006
  15. pack-objects: avoid delta chains that are too long.Junio C Hamano, Feb 18, 2006
  16. Linus TorvaldsFeb 17, 2006
  17. Junio C HamanoFeb 17, 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.