[osg-users] Performance regression 3.6.3 vs 3.4.0

Andrew Cunningham osg-users at a-cunningham.com
Wed Aug 7 15:42:57 PDT 2019


Firstly, has anyone noticed that http://forum.openscenegraph.org is
basically off-line and has been malfunctioning for some time. The link to
the mailing list failed some time ago.

In any case....

I have noticed a serious performance regression when moving to 3.6.3 from
3.4.0

It's  become such an issue for me, such that I had to revert to 3.4.0.

The problem starts with Geometry::addPrimitiveSet

Note the commented out /*if (_useVertexBufferObjects)*/

bool Geometry::addPrimitiveSet(PrimitiveSet* primitiveset)
{
    if (primitiveset)
    {
        /*if (_useVertexBufferObjects)*/
addElementBufferObjectIfRequired(primitiveset);

The performance regression happens when adding large numbers of
PrimitiveSet*.
In 3.4.0 I did not use VBO's for this particular Geometry, but in 3.6.3 one
is required to use VBOs for all geometry.

The performance regression is caused by repeated patterns in the VBO code
that searches through vectors, an example below. As more and more data is
added, the slower the code gets.

unsigned int BufferObject::addBufferData(BufferData* bd)
{
    if (!bd) return 0;

    // check to see if bd exists in BufferObject already, is so return
without doing anything
    for(BufferDataList::iterator itr = _bufferDataList.begin();
        itr != _bufferDataList.end();
        ++itr)
    {
        if (*itr == bd) return bd->getBufferIndex();
    }


I can eventually work around the issue, by doing my work to coalesce
PrimitiveSets , but might be  a FYI for some users.

Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20190807/9bfb15a6/attachment.html>


More information about the osg-users mailing list