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

Re: [PATCH] multi item packed files

From
Linus Torvalds <torvalds@osdl.org>
Date
Apr 22, 2005, 16:22 UTC
Message-ID
<Pine.LNX.4.58.0504220916060.2344@ppc970.osdl.org>
In-Reply-To
<200504212016.16729.mason@suse.com>
On Thu, 21 Apr 2005, Chris Mason wrote:
> 
> We can sort by the files before reading them in, but even if we order things 
> perfectly, we're spreading the io out too much across the drive.
No we don't.

It's easy to just copy the repository in a way where this just isn't true: you sort the objects by how far they are from the current HEAD, and you just copy the repository in that order ("furthest" objects first - commits last).

That's what I meant by defragmentation - you can actually do this on your own, even if your filesystem doesn't support it.

Do it twice a year, and I pretty much guarantee that your performance will stay pretty constant over time. The one exception is fsck, which doesn't seek in "history order".

And this works exactly because: 
 - we don't do no steenking delta's, and don't have deep "chains" of data 
   to follow. The longest chain we ever have is just a few deep, and it's 
   trivial to just encourage the filesystem to have recent things together.
 - we have an append-only mentality.

In fact, it works for exactly the same reason that makes us able to drop old history if we want to. We essentially "drop" the history to another part of the disk.

		Linus
Previous: Chris MasonNext: Chris Mason
Message 11 of 17 in “multi item packed files”
  1. multi item packed filesChris Mason, Apr 21, 2005
  2. Linus TorvaldsApr 21, 2005
  3. Chris MasonApr 21, 2005
  4. Krzysztof HalasaApr 21, 2005
  5. Linus TorvaldsApr 21, 2005
  6. Krzysztof HalasaApr 22, 2005
  7. Martin UeckerApr 22, 2005
  8. Chris MasonApr 21, 2005
  9. Linus TorvaldsApr 21, 2005
  10. Chris MasonApr 22, 2005
  11. Linus TorvaldsApr 22, 2005
  12. Chris MasonApr 22, 2005
  13. Linus TorvaldsApr 22, 2005
  14. Chris MasonApr 22, 2005
  15. Chris MasonApr 22, 2005
  16. Chris MasonApr 25, 2005
  17. Krzysztof HalasaApr 22, 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.