[osg-users] Ready to tag OpenSceneGraph-3.3.8 dev release, please test
Jannik Heller
scrawl at baseoftrash.de
Mon Jun 8 09:18:57 PDT 2015
Hi Robert,
I tried my application using the latest trunk and didn't notice any functional regressions.
However, I did notice a performance decrease in the Update phase of about 20%, compared to OSG 3.2.0. This had me a bit concerned, so I digged through the changes and found commit https://github.com/openscenegraph/osg/commit/e967420323bb6e500425144cb305cf8060c1c515 .
Since that commit, we now get *four* dynamic_cast's per frame and NodeCallback, which I suspect is causing the slowdown. Two dynamic_cast's are in NodeCallback::run, then another two in NodeCallback::traverse.
Changing to the non-deprecated Callback instead of NodeCallback gives a slight improvement with now just two dynamic_cast's in Callback::traverse, but still isn't optimal.
Ideally, the application should be able to decide on the level of safety vs. level of performance it needs. If a Callback is only intended to be used on Nodes, there is little point in dynamic_casting to Node every frame.
I think I can workaround the casts by using a custom class derived from osg::Callback as the base class for all my node callbacks. Still, it's quite a peculiar situation that does affect all users of the OSG.
I guess my question comes down to, are there any plans on optimizing the Callback code before a final 3.4 release? If you aren't convinced, I can throw together a repro case and some profiling data, but I think the impact of 4 dynamic_cast's per frame and NodeCallback should be obvious.
Cheers,
Jannik
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=63985#63985
More information about the osg-users
mailing list