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

Re: [PATCH] change the unpack limit treshold to a saner value

From
Linus Torvalds <torvalds@osdl.org>
Date
Dec 7, 2006, 01:08 UTC
Message-ID
<Pine.LNX.4.64.0612061700120.3542@woody.osdl.org>
In-Reply-To
<Pine.LNX.4.64.0612061420410.2630@xanadu.home>
On Wed, 6 Dec 2006, Nicolas Pitre wrote:
> 
> This is why I think the current default treshold should be 3 instead of 
> the insane value of 5000.  But since it feels a bit odd to go from 5000 
> to 3 I setled on 10.
Definitely not.

We have a much easier time handling many loose packed objects than many pack-files. For many reasons, but two really obvious ones:

 - pack-file indexes get read in on startup, and we maintain an explicit 
   list of them. Having lots of pack-files adds overhead that doesn't 
   exist for lots of loose objects.
 - loose files are spread out over 256 subdirectories to make lookup 
   easier, packfiles are not (and always create an index file too).

So in general, as a trivial heuristic, you probably want about 512 times as many loose objects as you want pack-files, i fonly because of the latter issue, because you can much more easily handle lots of loose objects than lots of pack-files. So it's _not_ a factor of 3. Or even 10.

But since there _is_ reason to do pack-files too, and since using too big a value means that you never end up keeping a pack-file _at_all_ if you pull often, I'd suggest that rather than use a limit of 512 you go for something like 100-200 objects as the threshold (of course, the proper one would depend on the distribution of the size of your pack-files, but I'll just hand-wave and say that together with occasional re-packing, something in that range is _generally_ going to be a good idea).

Previous: Nicolas PitreNext: Nicolas Pitre
Message 4 of 8 in “change the unpack limit treshold to a saner value”
  1. change the unpack limit treshold to a saner valueNicolas Pitre, Dec 6, 2006
  2. Junio C HamanoDec 6, 2006
  3. Nicolas PitreDec 7, 2006
  4. Linus TorvaldsDec 7, 2006
  5. Nicolas PitreDec 7, 2006
  6. Linus TorvaldsDec 7, 2006
  7. change the unpack limit treshold to a saner valueNicolas Pitre, Dec 7, 2006
  8. Shawn PearceDec 7, 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.