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

Re: [BUG] fast-import producing very deep tree deltas

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Nov 12, 2007, 20:26 UTC
Message-ID
<alpine.LFD.0.9999.0711121221040.3062@woody.linux-foundation.org>
In-Reply-To
<20071112110354.GP6212@lavos.net>
On Mon, 12 Nov 2007, Brian Downing wrote:
Show 6 quoted lines
> 
>     depths: count 135970 total 120567366 min 0 max 6035 mean 886.72 median 3 std_dev 1653.48
> 
> Needless to say the pack that resulted was just about useless.  Trying to
> repack it resulted in the "counting objects" phase running at about five
> objects per second.

Hmm. Quick hack: increase the delta cache window. The reason (I think) why performance turns glacial with really deep delta chains is that it turns into an O(n^2) thing when you don't hit in the delta cache, and your delta depth is so deep that following a *single* delta chain will flush the cache.

So I bet that making the delta cache bigger will "fix" it. You probably don't have to make it 6000+ entries, but with the *median* being that deep, making it 2k entries should improve it for most cases.

Obviously fastimport should be fixed to not do those insanely deep chains too, but it might be a good idea to at least make the delta cache a bit bigger by default, and perhaps have some config option for setting it.

		Linus
Previous: Brian DowningNext: Shawn O. Pearce
Message 3 of 6 in “[BUG] fast-import producing very deep tree deltas”
  1. Brian DowningNov 12, 2007
  2. [BUG] fast-import quoting broken for renamesBrian Downing, Nov 12, 2007
  3. Linus TorvaldsNov 12, 2007
  4. Shawn O. PearceNov 13, 2007
  5. Shawn O. PearceNov 13, 2007
  6. Brian DowningNov 13, 2007

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.