Hi I am new jme3 user and I am confused due to critisim on java that java is slow for 3d games. Please answer me about java is how much powerful and how much complex games can be written in JME3
Just search the forum. This question comes up every month or so and is as old as Java.
The short answer is that the claim that Java is slow for 3D games is total bunk. The long answer is a little more complicated.
The “Java is slow” myth stems from two major sources: (1) in the early days (think Java 1.0) Java was a purely interpreted language, and bytecode interpreters are generally significantly slower than compiled languages, and (2) Java’s garbage collector can cause unpredictable pauses that make your framerate “hiccup”.
Regarding #1, Java has an outstanding JIT compiler (which is getting even better with each release, especially with the new Graal JIT coming) which means Java code often runs neck-to-neck with C++ (or at least close enough that in most cases the difference doesn’t matter). So #1 isn’t an issue, especially since the huge majority of the work for a 3D game is done directly in graphics hardware, making the language you use irrelevant.
Regarding #2, as long as you don’t create 10s of thousands of short lived temporary objects this probably won’t be an issue. If it is, there are many, many, many different ways to tune/swap Java’s GCs (some people just switch from the default GC to CMS and the issue resolves itself). At any rate, it’s hardly a showstopper. Developer skill and writing clean code is 1000x more important to writing a good game than the choice of language/engine. If you design well and write good code, JME will handle anything you throw at it, just like any AAA engine would.
This question was just asked in June.
…but one need only search for “java slow” in the forum search to find all kinds of links… going as far back as 2006.
Thank you very much for your serious reply. Thank you again.
Great answer. I’m saving it to slap to my friend’s faces every now and then
how about we pin it in the forum
Thanks, hope you get some use out of it. Slap them C++ snobs hard!