Why is C faster than Java: git vs JGit
1–10 of 106 posts
Re: Why is C faster than Java: git vs JGit
#2Re: Why is C faster than Java: git vs JGit
#3Re: Why is C faster than Java: git vs JGit
#4This is an insightful post from the git mailing list which shows some of the real limitations that a top tier developer hits when trying to write Java code as fast as neatly optimized C code. Definitely worth reading.
Re: Why is C faster than Java: git vs JGit
#5I had a similar experience when I was doing some Galois Field arithmetic in Java. You pay a huge penalty because of the absence of unsigned types. In our case we had to use long instead of int, which is extra costly, since many basic operations in Java return int by default.
Addition is XOR which is sign-agnostic. Multiplication has to be done via table lookups to be fast which also makes it sign agnostic.
Well, at least for p=2.
Re: Why is C faster than Java: git vs JGit
#6So why do they write and use jgit at google instead of just git?
The original goal of JGit/EGit was to provide an Eclipse plugin for working with software using the Git SCM. The Eclipse plugin is still the main goal of many of the developers, but we are open to anyone wanting to interface with other tools, Netbeans, Ant, Maven etc. For those, the JGit part provides a high performance API for working with Git repositories. The main other user of JGit, besides EGit, is Gerrit Code Review, which used by projects such as JGit (ofcourse), EGit (by implication) and Android.
Not sure if that provides a very good motivation, but there you go. :)
Re: Why is C faster than Java: git vs JGit
#7EDIT: This obviously came across a bit as language fanboyism, so I guess I should mention that the language features that let you do many of them let you shoot yourself in the foot just as easily as you can in C, and you can certainly argue that with a strong FFI you might as well just call into C if you really need that kind of low level performance..
Re: Why is C faster than Java: git vs JGit
#8I had a similar experience when I was doing some Galois Field arithmetic in Java. You pay a huge penalty because of the absence of unsigned types. In our case we had to use long instead of int, which is extra costly, since many basic operations in Java return int by default.
Why does signedness matter? Addition is XOR which is sign-agnostic. Multiplication has to be done via table lookups to be fast which also makes it sign agnostic. Well, at least for p=2.
Re: Why is C faster than Java: git vs JGit
#9So why do they write and use jgit at google instead of just git?
Re: Why is C faster than Java: git vs JGit
#10Does anyone know why this is the case?