How to configure Bullet for best multithreaded performance

User avatar
cippyboy
Posts: 36
Joined: Fri Aug 25, 2006 1:00 am
Location: Bucharest

How to configure Bullet for best multithreaded performance

Post by cippyboy »

I've got back into Bullet after a number of years and I have to say I'm impressed with quite a few things that were solved or added. I'm especially impressed that dynamic triangle meshes work, unlike PhysX where they're "banned" :).

But on to my issue. I have a GPU benchmark app on 6 platforms and I was planning to add CPU benchmarking through physics processing as it's more interesting & fun that way.

And I tried to enable multithreading support in bullet, from 2 sources, one is the parallel dispatcher ( I'm using 2.78 btw ) the other being the m_enableSPU from DispatcherInfo. The Parallel dispatcher is actually slower while the m_enableSPU gives very small improvements, maybe 1-10% max. Is there anything I'm missing ? Are there some special classes I should create my code with ? I'm only using spheres colliding with triangle meshes and using only RigidBodies. I read on the forum that the OpenCL solution is faster, but my main platforms of interest ( iOS/Android ) do not support OpenCL yet.

Also as a side note, are the object transforms double buffered ? As in, can I safely call stepsimulation() on a thread while on a different thread I would call RigidBody->getWorldTransform(); so that I can at least render the last frame while simulating the current frame ?