Robert Osfield wrote:
I am aware of the topic of ordering data structures, but as yet
haven't spent much time looking at it.
In my sketch ups for an OpenSceneGraph-2.0 minimizing data structure
size and optimizing ordering have been something to strive for right
from the start. Performance with complex scene graph are heavily
dominated by cache missing, memory latency and bandwidth, these issue
remains totally outweigh FPU performance etc.
Just because I've been thinking about these optimization of data
structure for an OpenSceneGraph-2.0 doesn't mean we can't steadily
improve on the existing code base though :-)
It would be very useful to have a data structure analysis tool to
gleen info about the packing of data, even better what data is
accessed most often, with such analysis you'd have a good chance at
improving the later to avoid cache missing, and reduce overall memory
bandwidth demands.
Without this tool, one would have to do things by hand and do things
by trail and error
One thing to consider too is the use of base classes, which provide
use with generic functionality, they also might be bloating the data
structure such that the program flow will make requests over quite a
disperse range of memory to get all it needs. OO programming style
encourages this where appropriate, but it may be one of the things
that puts a spanner in the works w.r.t data structures optimized for
performance.
How does inheritance bloat a class? From my understanding, the class is
the same had a copy and paste been preformed, just with the benefit of
code reuse. Also, having the same matrix*vector code everywhere to avoid
a Matrix class is a very bad thing, as efficient matrix*vector code is
very machine-specific. That's just an example. One thing that would
improve matters is not reimplementing STL datatypes, like string. A lot
of code in a binding does this:
1: Internal string to C string
2:C string to STL string
3: STL string to osgText::String.
Talk about clearing a cache well. We are kicking out 3 entries per char
by doing this. Pass C strings instead. I understand Unicode issues, but
UTF-8 can't be that hard to handle if we just need to do a font lookup.
Of course, string mutation is an issue, but 2 copies is better then 3.
Does anybody have recommendation w.r.t anlysis tools? Perhaps we
might be able to write some ourselves.
Robert.
------------------------------------------------------------------------
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
--
They who would give up an essential liberty for temporary security,
deserve neither liberty or security
--Benjamin Franklin
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/