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

Re: space compression (again)

From
Linus Torvalds <torvalds@osdl.org>
Date
Apr 15, 2005, 18:34 UTC
Message-ID
<Pine.LNX.4.58.0504151117360.7211@ppc970.osdl.org>
In-Reply-To
<Pine.LNX.4.61.0504151232160.27637@cag.csail.mit.edu>
On Fri, 15 Apr 2005, C. Scott Ananian wrote:
Show 5 quoted lines
> 
> Why are blobs per-file?  [After all, Linus insists that files are an 
> illusion.]  Why not just have 'chunks', and assemble *these* 
> into blobs (read, 'files')?  A good chunk size would fit evenly into some 
> number of disk blocks (no wasted space!).

I actually considered that. I ended up not doing it, because it's not obvious how to "block" things up (and even more so because while I like the notion, it flies in the face of the other issues I had: performance and simplicity).

The problem with chunking is:
 - it complicates a lot of the routines. Things like "is this file 
   unchanged" suddenly become "is this file still the same set of chunks",
   which is just a _lot_ more code and a lot more likely to have bugs.
 - you have to find a blocking factor. I thought of just going it fixed 
   chunks, and that just doesn't help at all. 
 - we already have wasted space due to the low-level filesystem (as 
   opposed to "git") usually being block-based, which means that space 
   utilization for small objects tends to suck. So you really want to 
   prefer objects that are several kB (compressed), and a small block just
   wastes tons of space.
 - there _is_ a natural blocking factor already. That's what a file 
   boundary really is within the project, and finding any other is really 
   quite hard.

So I'm personally 100% sure that it's not worth it. But I'm not opposed to the _concept_: it makes total sense in the "filesystem" view, and is 100% equivalent to having an inode with pointers to blocks. I just don't think the concept plays out well in reality.

		Linus
Previous: C. Scott AnanianNext: C. Scott Ananian
Message 2 of 10 in “space compression (again)”
  1. C. Scott AnanianApr 15, 2005
  2. Linus TorvaldsApr 15, 2005
  3. C. Scott AnanianApr 15, 2005
  4. Derek FawcusApr 15, 2005
  5. Linus TorvaldsApr 15, 2005
  6. Martin UeckerApr 16, 2005
  7. C. Scott AnanianApr 16, 2005
  8. Martin UeckerApr 16, 2005
  9. Martin UeckerApr 19, 2005
  10. Derek FawcusApr 15, 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.