Hi John,

I have just done a review of your changes and for now won't merge them as
they involve too many ABI and internal code changes to risk merging with
OSG-3.2 branch, so I'll leave a second review till after 3.2 is out the
door.  In the meantime could you apply your changes to svn/trunk version of
Optimizer/Optimizer.cpp as you code is missing lots of modification that
have been made to svn/trunk.

One thing I will merge is the revision of Node::setDescriptions() as I feel
this is pretty benign, I did however rewrite it to use less code and
include a comment explaining it, my modifications are:


$ svn diff
Index: src/osg/Node.cpp
===================================================================
--- src/osg/Node.cpp    (revision 13656)
+++ src/osg/Node.cpp    (working copy)
@@ -475,7 +475,11 @@

 void Node::setDescriptions(const DescriptionList& descriptions)
 {
-    getOrCreateUserDataContainer()->setDescriptions(descriptions);
+    // only assign a description list (and associated UseDataContainer) if
we need to.
+    if (!descriptions.empty() || getUserDataContainer())
+    {
+        getOrCreateUserDataContainer()->setDescriptions(descriptions);
+    }
 }

Does this look OK?

Cheers,
Robert.



On 23 July 2013 10:11, PCJohn <[email protected]> wrote:

> Hi Robert,
>
> I am sending osgUtil::Optimizer improvements:
>
> - osgUtil::Optimizer SHARE_DUPLICATE_STATE speed (+320%) and memory
> optimizations. Tested on model with ~83'000 StateSets that originally took
> 3.0s to optimize. The time was reduced to 1.3s by optimizing handling of
> StateAttribute::_parents, e.g. reparenting of StateAttributes is very time
> costly on large parent sets, particularly removeParent uses std::find for
> linear search in std::vector<StateSet*> that is costly when vector is
> large.
> Using more effective std::sort instead of insert sort approach removed
> other
> 0.4s to final 0.9s.
>
> - minor improvements to MergeGeometryVisitor
>
> - MergeGeodesVisitor used to merge childrens bellow Groups only; now it can
> merge bellow MatrixTransforms, PositionAttitudeTransforms, Transforms,
> LightSources, and Projections.
>
> - Fixed Node::setDescription() to not allocate UserDataContainer when
> description is empty. This prevented many optimizations in
> osgUtil::Optimizer
> as nodes with UserDataContainer are not optimized while Optimizer itself
> used
> constructions like group->setDescriptions(transform->getDescriptions())
> resulting in UserDataContainer allocations, preventing further
> optimizations
> on the node.
>
>
> One more note: NO_PARENT_OPTIMIZATION define is used to remove parent
> optimization that brought 60% speed improvement for SHARE_DUPLICATE_STATE.
> If
> you feel it as too hacky approach, just delete the code. If you accept it,
> you
> may remove #ifndefs
>
> John
> _______________________________________________
> osg-submissions mailing list
> [email protected]
>
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to