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, 21:04 UTC
Message-ID
<20151214210429.GC14788@sigill.intra.peff.net>
In-Reply-To
<d0a39b03e49d41e685cf61398c0d1102@EXCHANGE2U.uunet.arlington.PredictiveTechnologies.com>
On Mon, Dec 14, 2015 at 01:47:39PM +0000, Daniel Koverman wrote:
Show 13 quoted lines
> > You might also try repacking with "git repack -adb", which will
> > build reachability bitmaps. Pack-objects can use them to compute
> > the set of required objects much faster.
> 
> Running "git repack -adb" caused my push time to incease by about 5x.
> I made some fresh clones and tried other options with repack, and
> consistently anything I tried with -b caused the push time to
> increase about 5x.
> 
> I don't know much about reachability bitmaps, but perhaps it is
> important to note that I timed the pushes after repacking on Git for
> Windows. My earlier timings were done on both Linux and Windows and I
> did not see a significant difference.

Hmm. I guess that makes sense. The bitmap we want is the set difference between the objects we are sending, and the tips the other side has. If we have a bitmap at each ref tip, that's very fast. But if you have a very large number of refs, we don't make one for each ref, and it has to fallback to walking to the nearest one (and it ends up worse than a regular walk, because it's filling in the bitmap for each tree, rather than just doing the "good enough" commit walk that we usually do).

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.

Thanks for trying out my suggestion.
-Peff
Previous: Daniel KovermanNext: Jonathan Nieder
Message 8 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.