This is an article on Gamasutra, maybe we should back him up the comments have not been too positive.
It’s quite odd that he start “I am speaking to anyone but console/mobile/AAA developers here.”
Androis is biggest mobile platform now and it’s still growing fast. So why rule all mobile developing with Java at start.
A pretty bad article, in my opinion. Mostly hearsay and not very well structured.
Couldn’t quite see the purpose to that article.
Cas
Yeah I agree, poorly purposed. Although he admits in the article that he forgot to mention who he was speaking to:
“… unfortunately, I stupidly left out the real target audience for my article: hackers and hobbyists”
Just thought we should mention some positives. For some reason it was ranked high on Hacker News so it got some views because of it.
When I read the article I felt like the guys writing it just realized a week ago that there was a language named Java…
Not only on Android, Java is also featured on Nokia Qt.
good intentions for supporting Java
Though I feel like it was written poorly, quickly, and with little actual research or knowledge.
Its unfortunate
[quote]some tests suggest that Java can actually exceed the speed of C/C++ in certain cases
[/quote]
I have said that for years ;D
I have said that for years ;D
[/quote]
We do reasonably have to concede though that 99% of the time C++ is considerably faster most of the time. Java 7 will narrow the gap a little more. Riven’s sneaky Unsafe code could further narrow it where it counts for games developers.
Cas
I have said that for years ;D
[/quote]
You do realise that the JVM is written in C++, so its odd saying that Java is faster
Java’s main advantage is that you have to work less for better or equivalent results.
[quote=“kappa,post:11,topic:36933”]
It is not odd as I studied the way of implementing programming languages during my (unfinished) Master degree, I know a bit what I’m talking about. I have read several times some parts of the source code of Java, I noticed that there is some C source code some years ago, I have only noticed some C++ code recently when trying to recompile OpenJDK. Java uses both C, C++ and assembler, I don’t understand why it is odd to say that it is faster than C++ as Java is not C++, Java uses these other languages cleverly which explains why several IBM researchers in high performance computations told that Java can be faster than C/C++, especially in terms of speed of allocation and method calls.
Yeah, @kappa’s argument isn’t a good one really Though there are other factors such as the GC which are written in C, etc. but indeed, the bytecode compiler produces machine code, it’s not C++.
It just doesn’t produce machine code that’s anywhere near as fast as natively written C++ code does… yet.
Cas
iiii knew that, just testing :persecutioncomplex:
I believe Watson, The worlds best Jeopardy player (the super smart conversation AI) was written in mostly Java.
Clearly he is super intelligent and calculating millions of words, tones, emphasis, and other variables all the time at super high speed!
As stated before, honestly the difference in speed if less than 5% doesn’t really matter that much in the grand scheme of things. You can look at a console for example and see mind blowingly different capabilities within the same system, and it comes down to how much time and effort programmers came to push the system.
And as stated before, even if we stated C++ had a 5% better performance boost naturally over Java. If you can write the same code in 30% less time(if you take into account the Java is supposed to make things easier for programmers), that 30% time saved can then be converted into making “better” code and thus end up being faster than C++ given the same time constraints.
And if you are triple AAA big business and a particular form of calculation or method is faster in a specific language, I thought most “BIG BIG Companies and applications/games” usually had programs that utilized several languages at once because sometimes a different languages perform certain task significantly better.
@namrog84 - it’s more like about 50% not 5% for games, typically.
(I was going to say that this is a problem but really it’s only a problem for the sort of games that need to use 100% of what’s out there and that’s basically AAA titles. And we all know how many AAA titles have been written in Java.)
Also, coding is a rather small part of the development budget these days. Saving 30% off of a mere 10% of the budget is barely worth it considering the huge tradeoffs a studio would have to make to switch to a Java toolchain. A bit of a catch-22 situation unfortunately. But largely brought about by senior Sun mismanagement. There should have been a shit hot JVM on PS3 and indeed 360 and iPhone but they fucked every one of them up.
Cas
is it really a 50% performance increase? I didn’t think it was nearly that high? (Java isn’t that bad? is it )
What about non games?
Yeah I know a lot goes into content development, from level design, balancing, art, media, etc…
I was always quite discouraged that they didnt manage to get a JVM on the 360 or ps3
Lack of SIMD really hurts. On ‘old’ CPUs the performance difference was factor 2, now it’s factor 4, as modern CPUs don’t spread SSE2 operations over two cycles anymore.
When doing vector math, 90% of the CPU time is still spent in 0.5% of your code, and that 0.5% will not even be remotely as fast as hand-optimized assembler – 50% doesn’t even come close in that part of your engine.
Overall yes I’d say Java is about half the speed of C++ for games in typical situations, and that doesn’t even take into account the lightning fast startup time of native code (which believe me does have quite an effect on perceived performance). Some sorts of stuff as Riven points out are tragically slow in Java, unfortunately the kinds of stuff that are very common in games programming. Some serious effort in SSE optimisation for the Sun JVM wouldn’t go amiss. The other big bottleneck is bounds checking.
Cas
I can get 60 fps on 30 dollar hardware new for 2d action games and next year it will be 25 dollars and 12 months from now it will be 20 dollars.
So Java is plenty fast.