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

Re: [PATCH 1/3] Lazily open pack index files on demand

From
Nicolas Pitre <nico@cam.org>
Date
May 27, 2007, 02:43 UTC
Message-ID
<alpine.LFD.0.99.0705262223540.3366@xanadu.home>
In-Reply-To
<56b7f5510705261031o311b89bapd730374cbc063931@mail.gmail.com>
On Sat, 26 May 2007, Dana How wrote:
Show 10 quoted lines
> I think there are two interesting strategies compatible
> with maximally-informative timestamps:
> 
> (1) git-repack -a -d repacks everything on each call.  You would need:
> (1a) Rewrite builtin-pack-objects.c so only the object_ix hash
>       accesses the "objects" array directly, everything else
>       goes through a pointer table.
> (1b) Sort the new pointer table by object type,  in order
>       tag -> commit -> tree -> nice blob -> naughty blob.
>      The sort is stable so the order within each group is unchanged.

This is not a good idea in general for runtime access to the pack. If you consider a checkout, the commit object is looked up, then the root tree object, then each tree entry is recursively looked up. Right now the way the objects are laid out, the most recent commit will have all its objects contiguously found in the pack and in the right order (that means tree and blobs mixed up). This gets less and less true as you go back into history, but at least the recent stuff has a really nice access pattern.

Because commit objects are so fundamental to many graph operations they are already all packed together. But tree and blob objects are intermixed for the reason stated above.

The naughty blob is a really special category and I think they should be treated as such. Therefore I don't think the common/normal case should be impacted with a generic change for something that is still a special case.

In other words, I think the naughty blob could simply be recognized as such and be referenced in a special list instead of being written out initially. Then when everything is believed to be written, the special list can be walked to force write those naughty blob at last. No need to modify the current object order.

Nicolas
Previous: Dana HowNext: Dana How
Message 5 of 22 in “Lazily open pack index files on demand”
  1. 1/3 Lazily open pack index files on demandShawn O. Pearce, May 26, 2007
  2. Junio C HamanoMay 26, 2007
  3. Shawn O. PearceMay 26, 2007
  4. Dana HowMay 26, 2007
  5. Nicolas PitreMay 27, 2007
  6. Dana HowMay 27, 2007
  7. Nicolas PitreMay 27, 2007
  8. Shawn O. PearceMay 27, 2007
  9. Dana HowMay 27, 2007
  10. Nicolas PitreMay 27, 2007
  11. Shawn O. PearceMay 27, 2007
  12. Dana HowMay 28, 2007
  13. A Large Angry SCMMay 28, 2007
  14. Nicolas PitreMay 28, 2007
  15. Nicolas PitreMay 28, 2007
  16. Nicolas PitreMay 27, 2007
  17. Dana HowMay 27, 2007
  18. Shawn O. PearceMay 27, 2007
  19. Nicolas PitreMay 27, 2007
  20. Linus TorvaldsMay 28, 2007
  21. Nicolas PitreMay 28, 2007
  22. Karl HasselströmMay 28, 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.