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

Re: Why Git is so fast (was: Re: Eric Sink's blog - notes on git, dscms and a "whole product" approach)

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
May 1, 2009, 18:43 UTC
Message-ID
<alpine.LFD.2.00.0905011431460.5379@localhost.localdomain>
In-Reply-To
<20090430142244.GA23550@coredump.intra.peff.net>
On Thu, 30 Apr 2009, Jeff King wrote:
> 
> Like all generalizations, this is only mostly true. Fast network servers
> with big caches can outperform disks for some loads.
That's _very_ few loads.

It doesn't matter how good a server you have, network filesystems invariably suck.

Why? It's not that the network or the server sucks - you can easily find beefy NAS setups that have big raids etc and are much faster than most local disks.

And they _still_ suck.

Simple reason: caching. It's a lot easier to cache local filesystems. Even modern networked filesystems (ie NFSv4), that do a pretty good job on a file-per-file basis with delegations etc, and they still tend to suck horribly at metadata.

In contrast, a workstation with local filesystems and enough memory to cache it well will just be a lot nicer.

> So I wouldn't rule out the possibility of a pleasant VCS experience on a
> network-optimized system backed by beefy servers on a local network.
Hey, you can always throw resources at it.
But no:
> I have never used perforce, but I get the impression that it is more 
> optimized for such a situation.

I doubt it. I suspect git will outperform pretty much anything else in that kind of situation too.

One thing that git does - and some other VCS's avoid - is to actually stat() the whole working tree in order to not need special per-file "I use this file" locking semantics. That can in theory make git slower over a network filesystem than such (very broken) alternatives.

If your VCS requires that you mark all files for editing somehow (ie you can't just use your favourite editor or scripting to modify files, but have to use "p4 edit" to say that you're going to write to the file, and the file is otherwise read-only), then such a VCS can - by being annoying and in your way - do some things faster than git can.

And yes, perforce does that (the "p4 edit" command is real, and exists).

And yes, in theory that can probably mean that perforce doesn't care so much about the metadata caching problem on network filesystems - because p4 will maintain some file of its own that contains the metadata.

But I suspect that the git "async stat" ("core.preloadindex") thing means that git will kick p4 *ss even on that benchmark, and be a whole lot more pleasant to use. Even on networked filesystems.

			Linus
Previous: Jeff KingNext: Jeff King
Message 29 of 39 in “Eric Sink's blog - notes on git, dscms and a "whole product" approach”
  1. Martin LanghoffApr 27, 2009
  2. Cross-Platform Version Control (was: Eric Sink's blog - notes on git, dscms and a "whole product" approach)Jakub Narebski, Apr 28, 2009
  3. Robin RosenbergApr 28, 2009
  4. Martin LanghoffApr 29, 2009
  5. Jeff KingApr 29, 2009
  6. Markus HeidelbergApr 29, 2009
  7. Jakub NarebskiApr 29, 2009
  8. Martin LanghoffApr 29, 2009
  9. Jakub NarebskiApr 28, 2009
  10. Sitaram ChamartyApr 29, 2009
  11. Why Git is so fast (was: Re: Eric Sink's blog - notes on git, dscms and a "whole product" approach)Jakub Narebski, Apr 30, 2009
  12. Michael WittenApr 30, 2009
  13. Jakub NarebskiApr 30, 2009
  14. Shawn O. PearceApr 30, 2009
  15. Kjetil BarvikApr 30, 2009
  16. Shawn O. PearceApr 30, 2009
  17. Kjetil BarvikApr 30, 2009
  18. Steven NoonanMay 1, 2009
  19. James PickensMay 1, 2009
  20. Kjetil BarvikMay 1, 2009
  21. Mike HommeyMay 1, 2009
  22. Kjetil BarvikMay 1, 2009
  23. Tony FinchMay 1, 2009
  24. Dmitry PotapovMay 1, 2009
  25. Mike HommeyMay 1, 2009
  26. Dmitry PotapovMay 1, 2009
  27. Shawn O. PearceApr 30, 2009
  28. Jeff KingApr 30, 2009
  29. Linus TorvaldsMay 1, 2009
  30. Jeff KingMay 1, 2009
  31. david@lang.hmMay 1, 2009
  32. Nicolas PitreMay 1, 2009
  33. Daniel BarkalowMay 1, 2009
  34. Linus TorvaldsMay 1, 2009
  35. david@lang.hmMay 1, 2009
  36. Nicolas PitreApr 30, 2009
  37. Alex RiesenApr 30, 2009
  38. Andreas EricssonMay 4, 2009
  39. Jakub NarebskiApr 30, 2009

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.