3 ms·
I was countering the headline, which wasn't correct. Java isn't slower than C in general. It may be in specific cases, for specific programmers, etc but that's
by axod 17y ago
I was countering the headline, which wasn't correct. Java isn't slower than C in general. It may be in specific cases, for specific programmers, etc but that's not what the headline stated.
The title takes one specific application in a particular niche, used in a certain way which a particular programmer can't get to run fast enough, and concludes that Java isn't fast enough. Faulty logic.
The argument about JGit vs C-git for me isn't something I feel you can learn anything from.
- wvenable 17y ago> Java isn't slower than C in general. Really? In general? That statements seams worse than the original headline. Is Java faster than C for anything?
- axod 17y agoIt completely depends. Both are silly generalizations. 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.
- rbanffy 17y ago"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.
- axod 17y agoYou can't see a situation where the JVM can optimize things, inline code, etc at runtime and beat a general C implementation? :/
- wvenable 17y agoA 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?
- rbanffy 17y agoI 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.