[java] Will Java ever had the speed/facilites of C++?

Started by
68 comments, last by GameDev.net 19 years, 5 months ago
Quote:Original post by tombr
The modern garbage collector does an excellent job. It won't make the game stutter even if you create loads of garbage. Most of the garbage is collected in a fraction of a millisecond.

You can also avoid creating garbage. My game loop only generates a few kb of garbage each frame. The gc runs once every few seconds and uses a fraction of a millisecond. There is no stutter and it don't use much time either.

There are also tools to optimize the garbage collector parameters. Allowing you to optimize the garbage collector to your game.


Plus, if you are adventurous, you can write your own garbage collector.
Advertisement
Quote:Original post by TomX
Hi,

Well the subject is self-explanatory I think, will Java have the speed and graphical facilites as good as C++?

Will Java ever be able to compete with C++ in terms of 3D games?

Thanks in Advance
TomX


Why does crap like this not get moderated? The OP screams "troll" with some assumptive questions that are not based in fact but fantasy, and people respond with random bull**** about how GC is slow, as if they know what they're talking about.

I've read every reply and almost all of them contain at least one derogatory comment which is simply not true, and demonstrates that the poster is either naive, stupid, or lazy (i.e. they have their head in the sand and don't listen to the world around them OR they are too braindead to understand simple english OR they can't be bothered to learn how to program java properly).

For anyone actually interested in the real world, I suggest you ignore everything in this thread and go to a real forum like www.javagaming.org, where you can ask questions of people who actually use the language; professional java games developers and professional mainstream IT developers; people who - not to put too fine a point on it - actually understand what they're talking about.

And to the OP: What you're asking about happened a couple of years ago. Not that this really matters so much: in the games industry, speed is usually less important than project cost (3000 games released each year, less than 50% break even in project costs. They aren't going bankrupt and sacking the staff, or failing to pay wages, because the frame rate was too slow...)

Sheesh. No wonder the java forum on GD is dead - 99% noise, 1% signal?
Java OpenGL/DirectX where available acceleration enabled under the hood. C++ Graphic acceleration in C++ standard library? Where?

to Escherial
On modern processors C program would highly likely run in emulated mode. This would apply for D, Delphi, and other statically compiled languages. ONLY language that's unlikely to be runned in "emulated" mode is ASM, and only becose it was optimalized already.

to wyrzy
Quote:deleting objects when you want to is going to be faster than using a garbage collector. Why? Because you could do things like, putting all of the objects that will be deleted in a list, and then actually delete them in between levels. Although it may be slower than using the garbage collector, I think most people would prefer a little lag time when switching levels

I supose you never wrote a game. Right? Putting all "you know them sooner than on the runtime and reliably on top of that" objects...
BTW users DISLIKE lag time when switching levels. Also users dislike swithching levels.
DirectX is monstrosity from Mickerosoft that looks and behaves horrible. The worst thing about it is COM. JNI is COM compatibile so creating DirectX layer for Java exactly like for C# isn't a problem. There isn't any DirectX on Unix, nor on MAC. This means, why DirectX when we can use OpenGL?

Is this a trollfest? Aka who would write the most biased Java post of this month?
1.4.2 released new collectors. There aer a variety of possibilities and they can be highly tuned based on type of application as well as type of hardware. Read the docs if you really want to know the different possibilities. 1.5 will likley introduce even more options as well as further optimizations.

There are plenty of articles showing current Java apps to be faster than C++, and vice versa. The previous slowness of Java is gone. It is now much more a matter of the programmer's ability. A C++ programmer will write faster C++ than Java, a Java programmer will write faster Java than C++. Highly optimized applications compete with one another, each having strengths in different areas.

There is a lot of information on this, and what it comes down to is:

1.) Yes, it is possible to write decent games in Java
2.) Examples exist
3.) You need to do some research and some tests to decide if it is suitable for your app or not.
The Tyr project is here.
Sun's 5.0 VM has the following experimental options

-XX:MaxGCMinorPauseMillis
-XX:MaxGCPauseMillis

which some people say have totally eliminated GC pauses. Also with dual core chips becoming common in the next couple years GC is only going to become faster.
"... we should have such an empire for liberty as she has never surveyed since the creation ..."Thomas Jefferson
An optimal solution in C++ will always be faster than an optimal solution in Java.

Prove me wrong.

Konfu
Quote:Original post by Konfusius
An optimal solution in C++ will always be faster than an optimal solution in Java.

Prove me wrong.

Konfu


In some cases Java may be faster due to it's dynamic compilation.
Google for dynamic vs static compilation.
C++ didn't kill Java. .NET did.
HxRender | Cornerstone SDL TutorialsCurrently picking on: Hedos, Programmer One
Quote:Original post by PnP Bios
C++ didn't kill Java. .NET did.


Java's very alive and C# is just gonna breed even more life into it.
Quote:Original post by amannis
Quote:Original post by PnP Bios
C++ didn't kill Java. .NET did.


Java's very alive and C# is just gonna breed even more life into it.


Hows that?
HxRender | Cornerstone SDL TutorialsCurrently picking on: Hedos, Programmer One

This topic is closed to new replies.

Advertisement