Hacker News new | past | comments | ask | show | jobs | submit login

Why then don't people write in Java for performance? HotSpot has this runtime information. It runs OK (GCCish) for code that gets past the JIT threshold and dog slow otherwise. Hell, Java 9 is offering AOT.

JITs have been around for 30+ years and they're umm OK. As in not magical.




> Why then don't people write in Java for performance?

They do. Just like people write for PyPy for performance.

The only challenge to Java's performance is from languages without dynamic GC and with detailed static type information: C, C++, Rust. Even then, Java is usually "only" half the speed.

And AOT is coming for fast start-up, not good steady-state performance.


The things that make Java slow compared to C++ aren't in the compiler so much as in the language. In a sentence, Java made tradeoffs for productivity and simplicity that in C++ went in favor of performance and power.


Well, back in the day, the Sun people were crowing that HotSpot would be faster than C++.


Lots of people do write in Java for performance. It is all relative.

JIT performance benefits are highly dependent on the language.


Performance of generated code for Java is actually pretty fantastic. As far as I know, most of the performance ceiling now is because pointer indirection and cache misses. Java's "everything is a reference to a heap-allocated object" model is nice for simplicity, but it's very expensive in today's world where you really don't want to fall down the memory hierarchy.




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

Search: