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