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

Re: [PATCH] pack-objects: emit base before delta.

From
Linus Torvalds <torvalds@osdl.org>
Date
Jul 1, 2005, 15:28 UTC
Message-ID
<Pine.LNX.4.58.0507010821140.14331@ppc970.osdl.org>
In-Reply-To
<7vbr5nxe38.fsf@assigned-by-dhcp.cox.net>
On Thu, 30 Jun 2005, Junio C Hamano wrote:
>
> This micro-optimizes the order of objects in a pack.  By
> emitting base objects before deltified ones, unpack-objects do
> not keep items on delta_list.

So I like this from an unpacking standpoint, but at the same time I don't actually think it's correct from an access pattern standpoint.

When using a pack file as a run-time object store, the current packing order means that we generally traverse the pack-file in a nice forward direction. We don't jump backwards in the file very much, which should be good both for CPU and disk caches (both of them tend to have prefetch logic that often works better for nice access patterns). So I was actually pretty happy with the fact that we packed "optimally" in this sense: if the object was an important delta (ie an early one), we'd basically end up always walking forward until we hit the object it was a delta against.

I dunno. Maybe it doesn't matter. Our other heuristics to pack recent objects before later one might mean that we tend to have mainly backwards-going deltas (both in history _and_ in pack file layout).

The expense of keeping track of delta objects isn't that high, and the "pending delta" logic in unpack-objects isn't that complicated, so ..

Do you have some other reason you want to do this?
		Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 4 in “pack-objects: emit base before delta.”
  1. pack-objects: emit base before delta.Junio C Hamano, Jul 1, 2005
  2. Junio C HamanoJul 1, 2005
  3. Linus TorvaldsJul 1, 2005
  4. Junio C HamanoJul 1, 2005

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.