Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Sep 19, 2013 9:27 pm 
Offline

Joined: Sat Nov 07, 2009 7:57 pm
Posts: 24
Hi,

well I planned to use the serialisation of the bvh and trimesh shapes to speedup my applications start time.
However currently while testing, I found the btBulletFile:parse(false) function to be unbelieavably slow, and assume I did something wrong.

This goes so far, that regenerating the 1million polygon shape and bvh is faster than loading it. Can this be right?


I save the shape with
Code:
 btDefaultSerializer*    serializer = new btDefaultSerializer();
        serializer->startSerialization();
        meshShape->serializeSingleShape(serializer);
        serializer->finishSerialization();


this needs around 960 milliseconds and is fine so far.

However loading needs (actually only parsing the file the rest is nearly not measurable) 2584 milliseconds
The relevant code is:
Code:
bParse::btBulletFile* bulletFile2 = new bParse::btBulletFile((char*)buffer,len); //file is actually loaded from ram
   bool ok = (bulletFile2->getFlags()& bParse::FD_OK)!=0;
   if (ok){
      printf("ok");
      bulletFile2->parse(false); //this here needs that long
      ... rebuilding with the data from it

Completly regenerating the shape needs less than 3000 milliseconds, so the time save is somewhat small.

I run on linux(ubuntu 13.04) x64
gcc/g++ 4.7.3

I assume I do something wrong? If not can anyone give sugestions to reduce the time for loading?


Top
 Profile  
 
PostPosted: Thu Sep 26, 2013 7:11 pm 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 4054
Location: California, USA
I am surprised that loading a .bullet file takes much time, there is not much going on under the hood, aside from pointer patching.
3 seconds for pointer patching seems wrong.

Can you reproduce this in the Bullet/SerializeDemo, loading your .bullet file?

Are you measuring an optimized build (-O2, "Release")?
Thanks,
Erwin


Top
 Profile  
 
PostPosted: Sat Oct 05, 2013 3:33 am 
Offline

Joined: Sat Nov 07, 2009 7:57 pm
Posts: 24
Hi, sorry for the late reply,

I use optimized build, yes.
I now use a different loading circumventing this problem, by using the bvh de/serializeinPlace with this for essentially the same data and nothing else changed the loading time is only a few ms.
The bvh itself is in the file 300mb in size.

Using my own file read write stuff semms to solved this, but the question remains, what in the parseFile could be so slow?
As far as I understood, it basically contains the same data I use now, only with some kind of chunked stuff. I don't get why it loads so much faster.

The demos are a bit problematic to get to work, as bullet is integrated into another library by build time.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group