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, 18:52 UTC
Message-ID
<Pine.LNX.4.64.0606141146310.5498@g5.osdl.org>
In-Reply-To
<Pine.LNX.4.64.0606141113130.5498@g5.osdl.org>
On Wed, 14 Jun 2006, Linus Torvalds wrote:
Show 5 quoted lines
> 
> You don't _need_ to shuffle. As mentioned, it will only affect the 
> location of the data in the pack-file, which in turn will mostly matter 
> as an IO pattern thing, not anything really fundamental.  If the pack-file 
> ends up caching well, the IO patterns obviously will never matter.

Actually, thinking about it more, the way you do things, shuffling probably won't even help.

Why? Because you'll obviously have multiple files, and even if each file were to be sorted "correctly", the access patterns from any global standpoint won't really matter, becase you'd probably bounce back and forth in the pack-file anyway.

So if anything, I would say
 - just dump them into the packfile in whatever order is most convenient
 - if you know that later phases will go through the objects and actually 
   use them (as opposed to just building trees out of their SHA1 values) 
   in some particular order, _that_ might be the ordering to use.
 - in many ways, getting good delta chains is _much_ more important, since 
   "git repack -a -d" will re-use good deltas from a previous pack, but 
   will _not_ care about any ordering in the old pack. As well as 
   obviously improving the size of the temporary pack-files anyway.
I'll pontificate more if I can think of any other cases that might matter.
		Linus
Previous: Linus TorvaldsNext: Keith Packard
Message 9 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.