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

Re: Understanding version 4 packs

From
Shawn O. Pearce <spearce@spearce.org>
Date
Mar 25, 2007, 09:40 UTC
Message-ID
<20070325094033.GJ25863@spearce.org>
In-Reply-To
<20070325084641.GG25863@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> wrote:
Show 5 quoted lines
> So what you will find is that the EXTOBJ_FILENAME_TABLE is dumped
> out behind all of the commits, but before the first OBJ_DICT_TREE,
> and since all trees tend to get converted to an OBJ_DICT_TREE,
> the EXTOBJ_FILENAME_TABLE is sandwiched exactly between the commits
> and the trees.
...
Show 8 quoted lines
> The reason we put the EXTOBJ_FILENAME_TABLE behind the commits is
> we often walk the commit chains (following parent pointers) without
> looking at the trees at all.  Consider `git log`, in the default
> settings we don't need the trees.  By keeping the filename table
> behind the commits the OS read-ahead buffering gets a better chance
> at loading all of the data we need, and none of the data we don't.
> 
> So that's why its where it is.
I just talked with Junio about this on #git.

My real reason for putting the EXTOBJ_FILENAME_TABLE here is "lack of a better reason". I just didn't write that above. ;-)

We want it before the first OBJ_DICT_TREE to help the unpackers.

And just like we don't currently ever store the delta base for an OBJ_TREE before the first commit (as commits always get packed first) we also don't store the EXTOBJ_FILENAME_TREE before the first commit.

Junio raised the point that in large projects `git log -- asm/i386` can be a very common/useful/necessary operation, and that in such cases we need to evaluate trees as part of the log operation. Any attempt to optimize for git-log without a path spec is wrong, wrong, wrong. I agree.

The part I quoted above was not trying to imply that Nico and I are optimizing for using git-log without a path limiter. It just read that way to Junio, and may read that way for others too. Hence this follow-up.

I'm open to suggestions about placement for EXTOBJ_FILENAME_TABLE, but I think its current position between commits and trees is the probably the best we can get.

-- 
Shawn.
Previous: Shawn O. Pearce
Message 19 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.