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

Re: If I were redoing git from scratch...

From
Shawn Pearce <spearce@spearce.org>
Date
Nov 4, 2006, 19:16 UTC
Message-ID
<20061104191651.GC2517@spearce.org>
In-Reply-To
<Pine.LNX.4.64.0611040829040.25218@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> wrote:
Show 7 quoted lines
> or for somebody who re-implements git in Java (where 
> performance isn't going to be the major issue anyway, and you probably do 
> "small" things like "commit" and "diff", and never do full-database things 
> like "git repack"), _then_ you can happily look at having something 
> fancier. Right now, it's too easy to just look at cumbersome interfaces, 
> and forget about the fact that those interfaces is sometimes what allows 
> us to practically do some things in the first place.
Yes and no.  :-)

As the only person here who has hacked on some of Git and also reimplemented the core on disk data structures in Java I can say I mostly agree with Linus.

Abstractions like the repository (to allow different GIT_DIRs to be used in the same process) isn't really a big deal and is not a large impact on performance. They could be implemented in the current C core.

But trying to abstractly represent an object in Java the same way that it is represented in Git costs a huge amount of memory. Java is at least 16 bytes of overhead per object, before you get to store anything in it. Translation: Linus is right, doing a real implementation of "git repack" in Java is nuts. It would barely be able to handle git.git, let alone linux.git or mozilla.git.

Previous: Linus TorvaldsNext: Robin Rosenberg
Message 4 of 7 in “If I were redoing git from scratch...”
  1. Junio C HamanoNov 4, 2006
  2. Jakub NarebskiNov 4, 2006
  3. Linus TorvaldsNov 4, 2006
  4. Shawn PearceNov 4, 2006
  5. Robin RosenbergNov 4, 2006
  6. Linus TorvaldsNov 4, 2006
  7. Linus TorvaldsNov 4, 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.