Hi all,
after some further testing, I have found some problem regarding loading of
OSB files. Please see attached code sample (modified testVRMLLoader.cpp) and
correct me if I`m wrong, but it seems that that loading time of OSB after
previously deleting nodes is much higher. Difference can be seen also on
relatively small files. Is there something wrong in sample code attached?

Kind regards,
Robert
#include "OSGSceneFileHandler.h"
#include "OSGFieldContainerFactory.h"
#include "OSGTime.h"


int main (int argc, char **argv)
{
    OSG::osgInit(argc,argv);

    OSG::NodeRecPtr              file;
    std::vector<OSG::NodeRecPtr> vFile;

    if(argc > 1)
    {
		//first round
        for(OSG::UInt32 i = 0; i < 2; ++i)
        {
			OSG::Time start = OSG::getSystemTime();
            file = OSG::SceneFileHandler::the()->read(argv[1], NULL);
            
            vFile.push_back(file);
            OSG::commitChanges();
            file = NULL;

			OSG::Time end = OSG::getSystemTime();
			std::cerr << "Took " << end-start << " seconds to load" << std::endl;
        }

        OSG::commitChanges();

        for(OSG::UInt32 i = 0; i < vFile.size(); ++i)
        {
            vFile[i] = NULL;
        }
		vFile.clear();

		OSG::commitChanges();

		//second round
		for(OSG::UInt32 i = 0; i < 2; ++i)
		{
			OSG::Time start = OSG::getSystemTime();
			file = OSG::SceneFileHandler::the()->read(argv[1], NULL);

			vFile.push_back(file);
			OSG::commitChanges();
			file = NULL;

			OSG::Time end = OSG::getSystemTime();
			std::cerr << "Took " << end-start << " seconds to load" << std::endl;
		}

		OSG::commitChanges();

		for(OSG::UInt32 i = 0; i < vFile.size(); ++i)
		{
			vFile[i] = NULL;
		}
		vFile.clear();

		OSG::commitChanges();
    }

    OSG::osgExit();
}
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to