#include "performance.h" #include #include #include #include #include #include struct Benchmark { Benchmark() { calibrate(); _beginTick = _timer.tick(); _endTick = _timer.tick(); } void calibrate(unsigned int numLoops = 100000) { osg::Timer_t beginTick = _timer.tick(); for(unsigned int i=0;i=1.0) std::cout<=0.001) std::cout<=0.000001) std::cout<(vm4))->method(), iterations) RUN(benchmark, (static_cast(vm4))->method(), iterations) RUN(benchmark, { VirtualMethod mm; mm.method(); }, iterations) RUN(benchmark, { VirtualMethod2 mm; mm.method(); }, iterations) osg::ref_ptr group = new osg::Group; osg::ref_ptr mt = new osg::MatrixTransform; osg::Node* m = mt.get(); CustomNodeVisitor cnv; RUN(benchmark, { osg::MatrixTransform* mtl = dynamic_cast(m); if (mtl) cnv.apply(*mtl); }, 1000) RUN(benchmark, { m->accept(cnv); }, 10000) }