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:18 UTC
Message-ID
<Pine.LNX.4.64.0606141113130.5498@g5.osdl.org>
In-Reply-To
<1150307715.20536.166.camel@neko.keithp.com>
On Wed, 14 Jun 2006, Keith Packard wrote:
Show 14 quoted lines
> On Wed, 2006-06-14 at 08:53 -0700, Linus Torvalds wrote:
> 
> >  - You can list the objects with "most important first" order first, if 
> >    you can.  That will improve locality later (the packing will try to 
> >    generate the pack so that the order you gave the objects in will be a 
> >    rough order of the resul - the first objects will be together at the 
> >    beginning, the last objects will be at the end)
> 
> I take every ,v file and construct blobs for every revision. If I
> understand this correctly, I should be shuffling the revisions so I send
> the latest revision of every file first, then the next-latest revision.
> It would be somewhat easier to just send the whole list of revisions for
> the first file and then move to the next file, but if shuffling is what
> I want, I'll do that.

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.

Eventually, after the whole import has finished, and you do the final repack, that one will do things in "recency order" (or "global reachability order" if you prefer), which means that all the objects in the final pack will be sorted by how "close" they are to the top-of-tree.

And that will happen regardless of what the intermediate ordering has been.

So if shuffling is inconvenient, just don't do it.

On the other hand, if you know that you generated the blobs "oldest to newest", just print them in the reverse order when you end up repacking, and you're all done (if you just save the info into some array before you repack, just walk the array backwards).

			Linus
Previous: Keith PackardNext: Linus Torvalds
Message 8 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.