Hacker News new | past | comments | ask | show | jobs | submit login
Notes on making JGit (Java Git) fast (gmane.org)
31 points by wanderingmarker on May 1, 2009 | hide | past | favorite | 6 comments



There's also a follow-up post in the same thread with a few more comments: http://article.gmane.org/gmane.comp.version-control.git/1180...


The most surprising part for me was: "But, JGit performs reasonably well; well enough that we use internally at Google as a git server."


Why would you find this surprising? C is usually less than 10x faster than the next tier of languages; Java, SBCL, GHC, C++, etc. 10x sounds like a lot, but considering languages like Ruby are often 300x slower than C, and they still perform just fine, you can see that Java's "slowness" is almost irrelevant.

Also, git spends a lot of time doing IO -- waiting for your hard drive to spin around is as fast in C as in Java.

(BTW, this is not advocacy for Java, rather, it's advocacy against using C when extremely good languages, like Haskell and Lisp are nearly as fast and are much easier to write.)

Edit: Ob-shootout-link: http://shootout.alioth.debian.org/u32q/benchmark.php?test=al...

For these benchmarks, Java is as fast as gcc. Git is a different workload, so I'm sure JGit is not equally fast as C-git, but it's not going to be unusably slow either. (As time goes on, C is a solution to fewer and fewer problems.)


I was referring to the fact that they use it at Google as a Git server, not the speed of Java.

LE: I am a Ruby developer and know what "fast enough" is. Also I know that Java/JVM is quite fast, JRuby is sometimes faster than Ruby 1.9.


Shawn is the author of Repo, Gerrit 2 and we use those tools and jgit quite a bit for distributing and developing Android. He's pretty awesome. (works for me, I'm proud to say)


Taking x2 as long as C is a great achievement, especially with Git, which is already extremely fast.

But they've done it by optimizing hell out of Java - it's far from idiomatic java, more like the C-style java you see in the standard Java libraries (but to be fair, C-Git has also had hell optimized out of it).




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: