Hi Jannik,

I made the asCamera() change in Transform.cpp yesterday as part of the
as*() changes I checked in, the const_cast<> removal is still needed
though so now merged and checked into github master.

Robert.

On 22 November 2015 at 18:50, Jannik Heller <[email protected]> wrote:
> Hi Robert,
>
> I have done some profiling and noticed that more than half of the time in 
> osg::TransformVisitor is being spent in dynamic_cast<osg::Camera*> calls.
>
> This patch replaces the dynamic_cast<osg::Camera*> with a node->asCamera(). 
> The Node::asCamera() function already existed before so there isn't a reason 
> not to use it.
>
> osg::computeLocalToWorld is used quite a lot in osgParticle and osgAnimation, 
> so speeding up that function results in a measurable performance increase for 
> many osg users.
>
> Here are some screenshots of the profiler:
>
> Before patch https://forum.openmw.org/download/file.php?id=701&mode=view
> With patch applied https://forum.openmw.org/download/file.php?id=702&mode=view
>
> Before you ask, yes the profiling was done in release builds.
>
> I've also removed a const_cast that wasn't necessary.
>
> Thank you!
>
> Cheers,
> Jannik
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=65732#65732
>
>
>
>
> _______________________________________________
> 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