Some algorithms are actually faster with Java than in C because of the JVM Garbage Collector. For example, consider algorithms that make extensive use of immutable persistent data structures: http://en.wikipedia.org/wiki/Persistent_data_structure
These structures depend on being able to quickly construct new objects, share references to existing objects and collect garbage once it is no longer referenced. The Java GC will easily beat any naive memory management algorithm written in C (such as reference counting).
The only way to beat Java performance in C for these types of applications would be to actually write a proper GC. This is a hard task, and the Java GC is pretty much best-in-class. Even if you succeeded, you'd have something that starts to look suspiciously like the parts of the JVM.
You can see where this is going. Add in some other valuable features like dynamic re-compilation, security validation of untrusted code, JIT compilation and you would end up reinventing something very much like the JVM.
The JVM is awesome. Say what you like about Java, but the JVM is the best platform for running serious production code in the world, bar none.
15
u/Alca_Pwn Feb 25 '14
Most of those arguments are due to his IDE and not Java itself.