"$$$" 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 »

_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.
Enough is never enough.
User avatar
_tommo_
Gnoll
Posts: 677
Joined: Tue Sep 19, 2006 6:09 pm
x 5
Contact:

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

Post by _tommo_ »

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.
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
x 58
Contact:

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

Post by betajaen »

Guys,

Please take it to the other C++ thread.
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 »

_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 :)
Enough is never enough.
Post Reply