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

Re: [PATCH] consider previous pack undeltified object state only when reusing delta data

From
Nicolas Pitre <nico@cam.org>
Date
Jun 30, 2006, 16:55 UTC
Message-ID
<Pine.LNX.4.64.0606301132510.1213@localhost.localdomain>
In-Reply-To
<44A518D6.8040901@op5.se>
On Fri, 30 Jun 2006, Andreas Ericsson wrote:
Show 15 quoted lines
> Johannes Schindelin wrote:
> > Hi,
> > 
> > On Thu, 29 Jun 2006, Nicolas Pitre wrote:
> > 
> > 
> > > Without this there would never be a chance to improve packing for
> > > previously undeltified objects.
> > 
> > 
> > Earlier this year, I was quite surprised to learn that multiple repackings
> > actually improved packing. Does that patch mean this feature is gone?
> > 
> 
> The patch Linus sent removes that feature. This one re-introduces it.
Not really.

Actually that multiple repacking "feature" was rather an artifact of the delta data reuse code and not really by design. Here's what happened before:

Consider the first repack where no delta exists, or "git-repack -a -f" where the -f argument makes it ignores existing delta data. In that case all objects are sorted and delta attempted on them within a window.

So to simplify things let's assume objects are numbered from 1 upwards. First obj #1 is added to the window. Obj #2 attempts a delta against obj #1. Obj #3 attempts a delta against objs #2 and #1. Obj #4 attempts a delta against objs #3, #2 and #1. And so on for all object: each new object attempts a delta against the last 10 objects (the default window size is 10) and the best delta, if any, is kept.

In the end, some objects get deltified, some don't, and a new pack is produced.

When repacking without -f to git-repack, then already deltified objects are simply copied as is from the existing pack(s) avoiding costly delta re-computation. Still, without Linus' patch, non-deltified objects were considered for deltification and deltas attempted on them.

So supposing that objects #1 through #10 were not deltified, and objects #11 through #50 were deltified, then those deltified objects were skipped over for the purpose of delta matching and therefore object #51 ended up attempting a delta against objs #1 to 10 instead of #41 to #50 like in the previous run. The net effect was similar to a larger window for some objects providing more opportunities for successful deltas, and therefore a smaller pack.

With Linus' patch those objects already known to be undeltified are, too, skipped. That means that successive git-repack without the -f argument are now producing identical packs all the time and the artifact above is gone.

I think this is a good thing since now the packing behavior is more predictable. But nothing is lost since if you want to have better packing like before you simply have to specify a slightly larger window size on the first git-repack. It'll take a bit more time but running git-repack many times also took more time in the end anyway.

Nicolas
Previous: Andreas EricssonNext: Andreas Ericsson
Message 29 of 36 in “Re: [RFC] Cache negative delta pairs”
  1. Junio C HamanoJun 29, 2006
  2. Jeff KingJun 29, 2006
  3. [RFC] Cache negative delta pairsJeff King, Jun 29, 2006
  4. Jeff KingJun 29, 2006
  5. Nicolas PitreJun 29, 2006
  6. Jeff KingJun 29, 2006
  7. Nicolas PitreJun 29, 2006
  8. Jeff KingJun 29, 2006
  9. Nicolas PitreJun 29, 2006
  10. Jeff KingJun 29, 2006
  11. Nicolas PitreJun 29, 2006
  12. Nicolas PitreJun 29, 2006
  13. Jeff KingJun 29, 2006
  14. Nicolas PitreJun 29, 2006
  15. Jeff KingJun 29, 2006
  16. Nicolas PitreJun 29, 2006
  17. Jeff KingJun 29, 2006
  18. Nicolas PitreJun 29, 2006
  19. Linus TorvaldsJun 29, 2006
  20. Nicolas PitreJun 29, 2006
  21. Linus TorvaldsJun 29, 2006
  22. Jeff KingJun 29, 2006
  23. Joel BeckerJun 29, 2006
  24. Nicolas PitreJun 29, 2006
  25. Junio C HamanoJun 29, 2006
  26. consider previous pack undeltified object state only when reusing delta dataNicolas Pitre, Jun 30, 2006
  27. Johannes SchindelinJun 30, 2006
  28. Andreas EricssonJun 30, 2006
  29. Nicolas PitreJun 30, 2006
  30. Andreas EricssonJul 3, 2006
  31. Jeff KingJun 29, 2006
  32. Junio C HamanoJun 29, 2006
  33. Junio C HamanoJun 29, 2006
  34. Junio C HamanoJun 29, 2006
  35. Jeff KingJun 29, 2006
  36. Jakub NarebskiJun 29, 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.