

Notes on making JGit (Java Git) fast - gcv
http://article.gmane.org/gmane.comp.version-control.git/118034

======
gcv
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...](http://article.gmane.org/gmane.comp.version-
control.git/118035)

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

~~~
jrockway
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...](http://shootout.alioth.debian.org/u32q/benchmark.php?test=all&lang=javasteady&lang2=gcc&box=1)

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.)

~~~
ropiku
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.

~~~
cdibona
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)

------
10ren
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).

