Parsing btBulletFile really slow?
Posted: Thu Sep 19, 2013 9:27 pm
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
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:
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?
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: Select all
btDefaultSerializer* serializer = new btDefaultSerializer();
serializer->startSerialization();
meshShape->serializeSingleShape(serializer);
serializer->finishSerialization();
However loading needs (actually only parsing the file the rest is nearly not measurable) 2584 milliseconds
The relevant code is:
Code: Select all
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
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?