Hi Robert,
thanks for reviewing. Your modification of Node::setDescription() looks good.
I agree with postponing of osgUtil::Optimizer changes till after 3.2. I will
sync with trunk
once 3.2 is out and resubmit the submission.
John
On Tuesday 23 of July 2013 11:20:05 Robert Osfield wrote:
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 diffIndex:
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][1]> wrote:
Hi Robert,
I am sending osgUtil::Optimizer improvements:
- osgUtil::Optimizer SHARE_DUPLICATE_STATE speed (+320%) and
memoryoptimizations.
Tested on model with ~83'000 StateSets that originally took3.0s to optimize.
The time was
reduced to 1.3s by optimizing handling ofStateAttribute::_parents, e.g.
reparenting of
StateAttributes is very timecostly on large parent sets, particularly
removeParent uses
std::find forlinear search in std::vector<StateSet*> that is costly when vector
is large.Using
more effective std::sort instead of insert sort approach removed other0.4s to
final 0.9s.
- minor improvements to MergeGeometryVisitor
- MergeGeodesVisitor used to merge childrens bellow Groups only; now it
canmerge bellow
MatrixTransforms, PositionAttitudeTransforms, Transforms,LightSources, and
Projections.
- Fixed Node::setDescription() to not allocate UserDataContainer
whendescription is empty.
This prevented many optimizations in osgUtil::Optimizeras nodes with
UserDataContainer
are not optimized while Optimizer itself usedconstructions like group-
>setDescriptions(transform->getDescriptions())resulting in UserDataContainer
>allocations,
preventing further optimizationson the node.
One more note: NO_PARENT_OPTIMIZATION define is used to remove
parentoptimization
that brought 60% speed improvement for SHARE_DUPLICATE_STATE. Ifyou feel it as
too
hacky approach, just delete the code. If you accept it, youmay remove #ifndefs
John_______________________________________________osg-submissions mailing list
[email protected][2]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org[3]
--------
[1] mailto:[email protected]
[2] mailto:[email protected]
[3]
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