[osg-users] Slow optimization and OpenFlight

Robert Osfield robert.osfield at gmail.com
Mon Nov 27 04:56:55 PST 2017

Hi Andreas,

On 24 November 2017 at 13:44, Andreas Ekstrand
<andreas.ekstrand at remograph.com> wrote:
> Forgot to mention that the geometry before and after optimization is
> identical in the different OSG versions, so the optimizer accomplishes the
> same thing, it just takes about 10 times longer.

I am currently investigating the issue, currently waiting on valgrind
--tool callgrind to complete to see what clues gives me.  It's already
been running quite a while so am getting on with other avenues of
investigation while I wait.

The changes to Optimizer.cpp that you sent to osg-submissions suggests
that it's the removeChild() that is the performance bottleneck.  The
changes you've proposed don't handle the case where a group can have
non Drawable children so can't be merged as is.  It's still a
possibility of merging it with mods to address this.

I'd like to get down to route cause of the bottleneck though, my best
guess right now is it's an issue of parts of the implementation
triggering a O(N^2) behaviour, i.e. large number of children being
merged.  It might be this can be resolved with the approach you took,
or it might be best adding better removeChildren() support that avoids
the O(N^2) behaviour, such as passing a list of nodes to remove.


More information about the osg-users mailing list