Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There are a couple of excellent mailing list posts discussing the relative speed of JGit and Git, which are excellent reading:

http://article.gmane.org/gmane.comp.version-control.git/1180...

http://article.gmane.org/gmane.comp.version-control.git/1180...

That said, there are probably very few applications that have been this heavily hand-optimised, and probably equally few where you actually need it. Where C really stomps Java is around very low level memory management, I think. With modern processors, code can benefit greatly from colocation of related data that can be very difficult to achieve in an idiomatic way with Java.

Edit: link layout



I find those posts particularly interesting because they are not the typical criticisms levelled at high level languages; for the most part those posts read as a detailed list of design mistakes in Java: no unsigned types, no 'struct'-style types, reliance on boxing for generic containers, no way to 'reinterpret' blocks of memory C-style, etc. When people complain about using java to write software you often hear these individual design decisions come up.

it's also interesting to note that there are usable HLLs that suffer from few of the problems noted in those posts: both D and C# (though the latter required a second version to get some of it right) provide a garbage collected, object oriented environment like Java, but also provide a lot of the primitives needed for the kind of optimization discussed: pointers, structures, unboxed types, reinterpretation, and unsigned values.

I think this suggests that the problem is less 'hig level' languages and more 'immature' ones: C is a very mature language, descended from other mature languages, while Java was one of the first mainstream languages to make many of its decisions and as a result even now some of the larger mistakes have yet to be corrected (lack of function types and checked exceptions being two examples). Younger languages like D get to benefit from those lessons in the same way that C/C++ benefited from the mistakes of their predecessors.


I agree that the criticisms are not typical, but I don't agree that they're necessarily design flaws - just things that make Java less suitable for certain tasks that require fine memory management or low-level bit twiddling. I write Java in some fairly high-performance scenarios and this is rarely a real problem (except maybe memory layout - having every object reference be a pointer does kill us occasionally, but again in specific circumstances). For the vast majority of applications it's a non-issue.


I find the lack of struct types, and the lack of unsigned integers especially frustrating.




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

Search: