"$$$" C++ Extension: Ruby Symbols and Lazy Enums

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
jjp
Silver Sponsor
Silver Sponsor
Posts: 597
Joined: Sun Jan 07, 2007 11:55 pm
Location: Cologne, Germany
Contact:

Re: "$$$" C++ Extension: Ruby Symbols and Lazy Enums

Post by jjp » Sun Feb 14, 2010 12:08 pm

_tommo_ wrote:but it is a good indicator of the performances of the Library IMHO.
This boxing & unboxing stuff is just one of the things to look out for when programming something where performance is critical in Java or C#, it isn't always obvious where it can occur. It isn't really a shortcoming of the library or language implementation but a result of these language's design.
0 x
Enough is never enough.

User avatar
_tommo_
Gnoll
Posts: 677
Joined: Tue Sep 19, 2006 6:09 pm
Contact:

Re: "$$$" C++ Extension: Ruby Symbols and Lazy Enums

Post by _tommo_ » Sun Feb 14, 2010 12:49 pm

Uhm i don't think the boxing has much to do with that slowdown... the iterator was over an ArrayList of a class, so no boxing/unboxing should occur... in fact i was comparing those two:

Code: Select all

for( MyClass c : myArray ) 
     ....

//and
MyClass c;
for( int i = 0; i < myArray.size(); ++i) {
     c = myArray.get(i);
     ...
}
IMHO in this code the problem is the use of iterators in the first version... also i noticed that often putting MyClass c inside the loop causes a slowdown, and that is something that should not happen.
0 x
OverMindGames Blog
IndieVault.it: Il nuovo portale italiano su Game Dev & Indie Games

User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
Contact:

Re: "$$$" C++ Extension: Ruby Symbols and Lazy Enums

Post by betajaen » Sun Feb 14, 2010 12:54 pm

Guys,

Please take it to the other C++ thread.
0 x

jjp
Silver Sponsor
Silver Sponsor
Posts: 597
Joined: Sun Jan 07, 2007 11:55 pm
Location: Cologne, Germany
Contact:

Re: "$$$" C++ Extension: Ruby Symbols and Lazy Enums

Post by jjp » Sun Feb 14, 2010 1:19 pm

_tommo_ wrote:IMHO in this code the problem is the use of iterators in the first version... also i noticed that often putting MyClass c inside the loop causes a slowdown, and that is something that should not happen.
Ok, I thought you'd be referring to for-each over integral data types :)
0 x
Enough is never enough.

Post Reply