DEV Community

Discussion on: Common Java myths and misconceptions

Collapse
 
leob profile image
leob • Edited

I'm also baffled by all those people claiming that Java is "slow" - its JIT compiler and its JVM are heavily optimized, for sure if you look at raw speed it runs circles around Ruby, Python, or PHP.

It's only when you start comparing it to C/C++ that you could call it "slow" but that's a weird comparison, C and C++ are like "high level assembly", they're used for totally different things than what Java is used for.

In reality the idea that Java is "slow" is an urban myth and not based on anything.

Collapse
 
alchermd profile image
John Alcher

This is actually the first time I read that "Java is slow" is a thing. I've always thought that the common disposition is to write your v1 on Python/PHP/Ruby, release it ASAP, and then rewrite it in Java for speed once you're earning millions.

Collapse
 
rapasoft profile image
Pavol Rajzak

Yeah, I've seen companies doing that. For instance writing machine learning/intensive data processing in Python and when bottlenecks are found, they rewrite parts of the application to Scala/Java.

Collapse
 
leob profile image
leob

I've heard the "Java is slow" thing many times, but I've never really understood where it comes from. Yes, if you write it in assembly or C then it's faster "duh" but that's not the point hope.

Maybe it harkens back to the old days of Java 1 and the failed "applets" concept, which gave it a bad name. And I see some people complaining about JVM startup time and memory usage, or GC pauses, although in those areas a lot of progress has been made as well.

If you can criticize Java for anything then it would be its verbosity and the slow evolution of the language (but even those two have been addressed recently) - but not its speed per se.