So I have recently been learning java and everywhere I go I hear that java is a slow language compared to C or c++. I know that when it came out in the 90's that it was a lot slower, but I was wondering how much slower is it today. Also when writing java programs do you ever really run into issues with how slow it is?

Votes + Comments
For the signature.
7 Years
Discussion Span
Last Post by pseudorandom21

Well performance is hardly an issue for most applications(as its unnoticeable). Java is being successfully used in several areas. I'm not a good/experienced Java programmer, but the reason people use languages like Java, C#, Python is the increased productivity.

You can search for benchmarks or make yourself and see. The reason Java is slower than C/C++ is because Java is compiled into Bytecode which is interpreted during runtime by JVM. C/C++ on other hand is compiled to native code(the machine code you call).

If some Java application needs performance boost in specific areas, you can write those part in C and interface it with jav using JNI.

Edited by vishesh: n/a


Hmm why not test yourself. Write a test application that does the things with standard libraries and primitive constructs.

The problem with Java is not running slow but memory usage I think. You can watch and read what Stroustrup explains about Java, C# and C++.


I don't normally opt to use applications written in Java because they seem to not be as responsive on my system. If an application written in a different language is available I normally choose it.

If one day soon bleeding-edge PC games are written in Java I will be surprised, but until then I think C/C++ is really the performance king.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.