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

Re: Why does send-pack call pack-objects for all remote refs?

From
Jeff King <peff@peff.net>
Date
Dec 14, 2015, 22:37 UTC
Message-ID
<20151214223717.GA20167@sigill.intra.peff.net>
In-Reply-To
<20151214223155.GA6594@google.com>
On Mon, Dec 14, 2015 at 02:31:55PM -0800, Jonathan Nieder wrote:
Show 20 quoted lines
> > I suspect there's room for improvement in the way we select commits to
> > store bitmaps for (so that the average walk is smaller). But it's rather
> > tricky; there's not a single constant to change to make it work better.
> 
> Git gc and JGit GC differ here.  JGit partitions the commits being
> packed by branch and then runs a selection algorithm on each part.
> Git runs a selection once on a list of all commits.
> 
> Some effects:
> - JGit selects more bitmaps, so the gc takes longer and the resulting
>   bitmap file is larger (bad)
> - JGit is more likely to have bitmaps for the commits involved in
>   pushes and fetches (good)
> 
> The commit selection code, for reference:
> 
> https://eclipse.googlesource.com/jgit/jgit/+/86af34e1/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapPreparer.java#151
> https://kernel.googlesource.com/pub/scm/git/git/+/ed1c9977/pack-bitmap-write.c#383
> 
> Thoughts?
My thought is it would be great if somebody wanted to work on this. :)

My understanding is that JGit's approach has some problems, too. Terry's message doesn't seem to have made it to the list, but you can see in the quoted bits he mentions some OOM problems during the bitmap write:

  http://article.gmane.org/gmane.comp.version-control.git/281476

That may not be a big deal to work around. I really just haven't looked at it at all. Vicent did the original bitmap selection code for C Git, and I don't think it has been touched since then.

-Peff
Previous: Jonathan Nieder
Message 10 of 10 in “Why does send-pack call pack-objects for all remote refs?”
  1. Daniel KovermanDec 7, 2015
  2. Junio C HamanoDec 7, 2015
  3. Jeff KingDec 7, 2015
  4. Daniel KovermanDec 8, 2015
  5. Jeff KingDec 10, 2015
  6. Nasser GrainawiDec 12, 2015
  7. Daniel KovermanDec 14, 2015
  8. Jeff KingDec 14, 2015
  9. Jonathan NiederDec 14, 2015
  10. Jeff KingDec 14, 2015

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.