I was profiling my application today and found that the overall performance 
bottleneck was in osgText::Text.

I built up a multi-line std::string on every frame with some changing data in 
it.  I then called "setText" on my osg::ref_ptr<osgText::Text> member variable 
and passed in the std::string.  The profiler identified the "setText" line as 
the bottleneck for the entire (large) application, cutting my frame rate in 
more 
than half.  Any idea why this might be a bottleneck or how I might speed things 
up?  It seems like a pretty basic action after a cursory look at the OSG source 
code behind it.

std::string outputText;

for(size_t i = 0; i < about7; i++)
{outputText += getData(i) + "\n";}
this->_text->setText(outputText);
Thanks.

- John Farrier
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to