Max Bandazian wrote on Friday, July 31, 2009 12:54 PM:
>            if (_children.size() == numChildrenToRemove)
>             {
>                _children.clear();
>             }
>             else
>             {
>                int numThingsToCopy = std::min(numChildrenToRemove,
>                _children.size() - numChildrenToRemove);
>                std::copy(_children.end() - numThingsToCopy,
_children.end(),
>             _children.begin() + pos);
_children.resize(_children.size() -
> numChildrenToRemove); } 
> 
> With this change, removing the 30,000 nodes takes less than 1 second.
It does
> change the semantics of removing children from a group, in that the
children
> will be in a different order rather than just having their index
changed. In
> my opinion it's worth it for the performance gain.   

That sounds pretty nice, but I must be missing something, because that
code looks like it does not change the order of the children. What's the
down side again?

-- 
Bryan Thrall
FlightSafety International
[email protected]
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to