[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] man oh man Java is painful



On Fri, Nov 4, 2011 at 5:27 AM, R. Alan Monroe <amonroe@xxxxxxxxxxxxxxx> wrote:
> (though I understand Java is capable of as good or better
> performance than C/C++)

In  execution  speed,  yes.  In RAM usage and startup time, definitely
not.
Also, not in execution speed.  Good C++ is always faster than Java code.  However, crappy C++ is slower than crappy Java code.  Because most programmers are crappy, nearly everything on the internet says that Java is faster.  From practical experience with C++ and with Java 7 (Oracle's latest and greatest), with only moderate optimization on identical programs, I know C++ to be at least twice as fast.

The only place Java has an advantage is memory allocation--and even that's not really fair; the JVM preallocates everything, so "allocating" and "deallocating" are almost no-ops.  If you want to do that, there are JIT compilers for C++ . . .

Ian