Re:Why git is so fast (or why Java is not as fast as C)
by rbanffy on Sunday January 03, 2010 @05:52AM
(#1028420)
"Yes Java can be faster than C in some situations."
Unless the person writing the C implementation is grossly incompetent, I would like to see even one example for that.
Re:Why git is so fast (or why Java is not as fast as C)
by axod on Sunday January 03, 2010 @12:06PM
(#1028683)
You can't see a situation where the JVM can optimize things, inline code, etc at runtime and beat a general C implementation? :/
Re:Why git is so fast (or why Java is not as fast as C)
by rbanffy on Sunday January 03, 2010 @03:14PM
(#1029029)
I would say that any C programmer worth his salt (unlike me) knows how to profile the code under a meaningful workload and how to optimize it to be faster.
I remember I used the shortest possible integers and the register keyword in the late 80's far too many times to count.
The point of somewhat higher-level languages like Java (I refuse to say Java is a high-level language - it would be one in the late 80s, but not today) is not to make programs run faster, but to make it easier to make them run correctly.
Re:Why git is so fast (or why Java is not as fast as C)
by wvenable on Sunday January 03, 2010 @01:52PM
(#1028860)
A Java application will invariably use more much memory than C implementation of almost any non-trivial application. You can inline code all you want, but it'll never change that. The JVM isn't magical -- it's not going to solve all your performance problems. When you're allocating a million tiny little objects with all the necessary accounting you can't optimize that away.
BTW, if it's so obvious why haven't you still provided at least one non-trivial concrete example of Java faster than C?
Yes Java can be faster than C in some situations.
Can C ever be faster than assembly? Well, in theory no. But in practice, sometimes.
Depends if you're a master assembly programmer who hand optimizes everything.