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

Re: Why do base objects appear behind the delta in packs?

From
Junio C Hamano <junkio@cox.net>
Date
Aug 29, 2006, 17:34 UTC
Message-ID
<7v8xl7moo7.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20060829162747.GA21729@spearce.org>
Shawn Pearce <spearce@spearce.org> writes:
Show 12 quoted lines
>> Shawn Pearce wrote:
>> 
>> > From a data locality perspective putting the base object before
>> > or after the delta shouldn't matter, as either way the delta
>> > is useless without the base.  So placing the base immediately
>> > before the delta should perform just as well as placing it after.
>> > Either way the OS should have the base in cache by the time the
>> > delta is being accessed.
>... 
> I'm going to shutup now and not say anything further on the subject
> unless I've got some hard results indicating a different organization
> is better or worse than what we have right now.

I think that may be a sensible thing to do (no sarcasm -- I think this measurement is long overdue).

The code was initially proposed just like you suggested but is in the current form precisely for the reason of avoiding back-seek. I distinctly remember me asking Linus "does mmap() favor forward scan by doing readahead? I thought its point was to allow random access" (the answer is "yes" and "yes but forward is the common case").

The pack-using side in sha1_file.c used to read deltified object (both header and delta) in full, pick up and read base, and apply delta to base. This was thought to be memory hungry on a longer delta chain, so the current code reads only the header of a deltified object, reads base, then reads the delta to apply. The last step involves seeking back, and might make the back-seek avoidance less effective than before.

Previous: Shawn PearceNext: Shawn Pearce
Message 5 of 9 in “Why do base objects appear behind the delta in packs?”
  1. Shawn PearceAug 29, 2006
  2. Nicolas PitreAug 29, 2006
  3. Jakub NarebskiAug 29, 2006
  4. Shawn PearceAug 29, 2006
  5. Junio C HamanoAug 29, 2006
  6. Shawn PearceAug 29, 2006
  7. Nicolas PitreAug 29, 2006
  8. Shawn PearceAug 29, 2006
  9. Jon SmirlAug 29, 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.