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

Re: Repacking many disconnected blobs

From
Linus Torvalds <torvalds@osdl.org>
Date
Jun 14, 2006, 19:18 UTC
Message-ID
<Pine.LNX.4.64.0606141212190.5498@g5.osdl.org>
In-Reply-To
<1150311567.30681.28.camel@neko.keithp.com>
On Wed, 14 Jun 2006, Keith Packard wrote:
> 
> Ok, sounds like shuffling isn't necessary; the only benefit packing
> gains me is to reduce the size of each directory in the object store;

There's actually a secondary benefit to packing that turned out to be much bigger from a performance standpoint: the size benefit coupled with the fact that it's all in one file ends up meaning that accessing packed objects is _much_ faster than accessing individual files.

The Linux system call overhead is one of the lowest ones out there, but it's still much bigger than just a function call, and doing a full pathname walk and open/close is bigger yet. In contrast, if you access lots of objects and they are all in a pack, you only end up doing one mmap and a page fault for each 4kB entry, and that's it.

So packing has a large performance benefit outside of the actual disk use one, and to some degree that performance benefit is then further magnified by good locality (ie you get more effective objects per page fault), but in your case that locality issue is secondary.

I assume that you never actually end up looking at the _contents_ of the objects any more ever afterwards, because in a very real sense you're really interested in the SHA1 names, right? All the latter phases of parsecvs will just use the SHA1 names directly, and never actually even open the data (packed or not).

So in that sense, you only care about the disksize and a much improved directory walk from fewer files (until the repository has actually been fully created, at which point a repack will do the right thing).

			Linus
Previous: Keith PackardNext: Nicolas Pitre
Message 11 of 15 in “Repacking many disconnected blobs”
  1. Keith PackardJun 14, 2006
  2. Shawn PearceJun 14, 2006
  3. Johannes SchindelinJun 14, 2006
  4. Junio C HamanoJun 14, 2006
  5. Sergey VlasovJun 14, 2006
  6. Linus TorvaldsJun 14, 2006
  7. Keith PackardJun 14, 2006
  8. Linus TorvaldsJun 14, 2006
  9. Linus TorvaldsJun 14, 2006
  10. Keith PackardJun 14, 2006
  11. Linus TorvaldsJun 14, 2006
  12. Nicolas PitreJun 14, 2006
  13. Keith PackardJun 14, 2006
  14. Linus TorvaldsJun 14, 2006
  15. Nicolas PitreJun 14, 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.