Java, C#, VM Performance and Benchmarks [OT]

Hasan Aljudy hasan.aljudy at gmail.com
Tue Mar 21 17:31:46 PST 2006


Craig Black wrote:
> "Kevin Bealer" <Kevin_member at pathlink.com> wrote in message 
> news:dvppn6$1ans$1 at digitaldaemon.com...
> 
>>In article <dvpmc3$15sk$1 at digitaldaemon.com>, Craig Black says...
>>
>>>There are so many people that are fooled by benchmarks indicating that 
>>>Java
>>>performs as well as C++.  Don't be an idiot!  Yes, there are programs that
>>>you can write in Java that will run as fast as the equivalent C++ 
>>>programs.
>>>These programs are typically small.  Notice that they do not use a lot of
>>>object instantiation.  In other words, you don't see a lot of "new 
>>>MyClass"
>>>in these programs.  But try to write a 3D game engine in Java.  I've 
>>>talked
>>>with some of the best game programmers in the world and they say the same
>>>thing:  Java is damn slow.
>>>
>>>-Craig
>>
>>I've talked to Java people who've said that Java is pretty fast, and the
>>performance loss is not too big of a deal.  But if you talk about putting 
>>4
>>integers in a class and then creating a container of those, they see that 
>>as
>>just a poor design, performance wise.
>>
>>In D you can do this with struct (similarly in C++), and it doesn't hurt
>>performance at all.  In Java, I think most experienced people would unroll 
>>the
>>struct and use an array of int.
>>
>>In other words (if this anecdote is true in general), experienced Java 
>>folk see
>>performance coding as a matter of getting rid of abstractions (i.e. class
>>definitions and the associated objects), because proliferating objects is
>>expensive in Java.
>>
>>D (and C++) allow you to keep these abstractions at no runtime cost, but 
>>the
>>language is a bit more complex (or in the case of C++, much more) by 
>>virtue of
>>having the extra syntax to make it possible.
>>
>>Kevin
> 
> 
> Abstraction is priority one when it comes to maintaining code, especially if 
> you have a lot of it.  If when using Java, I have to give up abstraction in 
> order to get performance, then my high performance Java code becomes less 
> maintainable.  I would definitely rather have the abstraction without the 
> performance hit.  D syntax is not much more difficult than Java.  Further, 
> it has much more expressive power.  Thus, for high-performance coding, and 
> for maintainability, D is the best choice.
> 
> -Craig 
> 
> 

Since we're talking about maintainablility vs performance, and someone 
just mentioned video games.

I was thinking, maybe a game engine can be a killer D app. It can 
demonstrate both the high performance and maintainability advantage that 
D provides.

Game engines are complicated, many game engines use very bad coding 
practices to gain performance (i.e. sacrifice maintainability in favor 
for performance).
Some people try to use Java to overcome the maintainability issue, but 
in the end they sacrifice performance.

I think D can win over both C++ and Java in this field (and in many 
fields, actually). What I'm trying to say is, I think a game engine can 
be a killer app that grabs everybody's attention towards D.



More information about the Digitalmars-d mailing list