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

Re: Understanding version 4 packs

From
Nicolas Pitre <nico@cam.org>
Date
Mar 26, 2007, 01:12 UTC
Message-ID
<alpine.LFD.0.83.0703252102520.3041@xanadu.home>
In-Reply-To
<20070325203141.GA12376@spearce.org>
On Sun, 25 Mar 2007, Shawn O. Pearce wrote:
Show 21 quoted lines
> Linus Torvalds <torvalds@linux-foundation.org> wrote:
> > On Sun, 25 Mar 2007, Shawn O. Pearce wrote:
> > > >
> > > > What happens to the paths, that do not have a correponding entry in the
> > > > path name table, because they are not among the 65535 most frequent
> > > > paths in the pack?
> > > 
> > > They don't appear in the table.  And any tree that uses them is
> > > forced to use the "legacy" OBJ_TREE encoding.  Which is what we
> > > have now in pack v2, and in loose objects.
> > 
> > Would it hurt too much to just make it four bytes, and avoid that issue?
> > 
> > Special cases - and *especially* special cases that are hard to trigger in 
> > the first place - equal bugs. And bugs are much much worse than trying to 
> > save a little bit of space.
> 
> Worth exploring.  When I get back to rebasing that topic onto
> Junio's tree I'll try a 4 byte index and see what kind of damage
> it does on space on large projects (Mozilla, linux-2.6, Eclipse).
> You may be right, an 8 byte record may just be worth the cost.

Maybe simply 3 bytes might be a good compromise too. I doubt a single pack is ever to contain 4G paths since it is limited to 4G _objects_ in the first place.

Another approach is to have the path index field width as the first item in such an object. This way it can be scalled as needed.

BTW Shawn there is no need to store the number of tree records at the beginning of the tree object since that can be deduced directly from the object size stored in the object header.

Nicolas
Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 7 of 19 in “Understanding version 4 packs”
  1. Peter EriksenMar 24, 2007
  2. Nicolas PitreMar 24, 2007
  3. Peter EriksenMar 25, 2007
  4. Shawn O. PearceMar 25, 2007
  5. Linus TorvaldsMar 25, 2007
  6. Shawn O. PearceMar 25, 2007
  7. Nicolas PitreMar 26, 2007
  8. Shawn O. PearceMar 26, 2007
  9. Jakub NarebskiMar 26, 2007
  10. Nicolas PitreMar 26, 2007
  11. Marco CostalbaMar 26, 2007
  12. Nicolas PitreMar 26, 2007
  13. Marco CostalbaMar 26, 2007
  14. Nicolas PitreMar 26, 2007
  15. Nicolas PitreMar 26, 2007
  16. Marco CostalbaMar 27, 2007
  17. Shawn O. PearceMar 27, 2007
  18. Shawn O. PearceMar 25, 2007
  19. Shawn O. PearceMar 25, 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.