[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A 21st Century Apple II?
On Mar 6, 7:15 am, "Michael J. Mahon" <mjma...@aol.com> wrote:
> sicklittlemonkey wrote:
> > On Mar 5, 8:35 pm, apple2fr...@gmail.com wrote:
> >> This is true in theory; however in practice I have yet to experience
> >> any Java program running more quickly (or with less memory) than an
> >> equivalent C++ program on any platform.
>
> > Experience away. I hope you'll excuse a C example:
> >http://bytonic.de/html/benchmarks.html
> > (Top right data cell.)
>
> The problem with overall speed metrics is that they do not reveal
> how much of the execution time is in the libraries vs. the calling
> code.
>
> The table, in fact, suggests that improvements to the graphics
> library were a prime component of the speed changes, and I'm guessing
> that it was not written in Java.
Actually, the differences are due to the code moving to the use of
vertex arrays instead of calling vertexAdd() to build display lists.
The OpenGL component is, as you point out, written in C, and Java
provides a thin wrapper over it.
The performance difference is due to the reduction in the number of
'native' method calls, which avoid the quite considerable overhead of
(de)marshalling and synchronisation (Java only allows a native method
to be called from one thread at a time).
All it shows is that since the majority of the graphics "heavy
lifting" is done by a third party API (much of which exists on a GPU
these days) you can write your "game logic" in Java without adding
considerable overhead.
Carmack made a similar assertion a few years back after completing
Doom III, and claimed that id's next engine would be written in Java
instead of C
Matt