Mike Jackson wrote:
  If some programmers out there have some performance tools to run against
OSG then that would make more sense than just blindly restructuring classes
in the hopes of getting some optimization.

Very interesting data. Thanks for the confirmation, Gordon, even if you can't share numbers.

Regrettably, no compiler I've met seems to be able to do this, and I can think of a number of ABI compatibility reasons why they'd be scared to.

I also don't know of any analysis tools for this, and I'm not even sure how you'd go about developing one. I think the best course would be simply to try reordering something and see if it performs better in a typical use case.

We could zero in on a likely core OSG class that is used heavily (Group? Drawable?) or several, and temporarily hack them and test them without checking them into CVS. Maybe post the hacked sources so a few others could run the same test in different environments and compare results (to make sure we're not improving performance on some environments at the expense of others...)

Or, we could construct a toy problem and test it both ways. This is less likely to be applicable, but might at least be a proof of concept. Mike (Jackson) -- do you recall what conference it was, and if the session material is available that we could refer to?

In theory, it is also a good idea to put most-used members at the start of a structure, and try to ensure members are access in a front-to-back order to ensure later accesses enjoy the pre-caching resulting from earlier ones (caches always over-fetch upward in memory).

Robert: The base class issue is interesting. It's hard to know exactly what a C++ compiler might be hiding in the prologue of your object (vptrs or RTTI data?) that might affect your alignment. Also, deriving from a base class starts you off aligned to the end of the base class -- the base class might need optional passing to assist the derived class in achieving alignment. This padding might be accomplished by some sort of macro or conditional compilation as it will add bloat to the data size that some might not appreciate.

  I guess the real issue is -- how much can this help -- is it worth doing?

--
Chris 'Xenon' Hanson aka Eric Hammil | http://www.3DNature.com/ eric at logrus
 "I set the wheels in motion, turn up all the machines, activate the programs,
  and run behind the scenes. I set the clouds in motion, turn up light and 
sound,
  activate the window, and watch the world go 'round." -Prime Mover, Rush.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to