Performance loss(frame rate drop) on body collisions

Hi,

In my game, I have some 40-60 box2D dynamic bodies arranged on a base polygon and gravity is applied on those bodies. When the simulation starts, game's frame rate is dropping from 60 to 18-28 range 😮 . Once all the bodies sleep, the frame rate comes back to 60. How can I improve the frame rate of the app? The problem is definitely coming from inside box2D, since, I tried switching off the simulation and the frame rate stays at 59-60fps.

Also, the frame rate drop comes only when bodies are awake. I'm stepping b2world with 0.024 time step, 8 velocity iteration and 3 position iterations.

The game is in iOS. The devices, I used were iPhone4, iPhone3GS and iPad.

UPDATE: The game is running in release mode and thumb support is disabled.

Can anybody please help me?

Regards,

Suraj
How are the bodies positioned when they start? Performance can be bad if you start them all on top of each other.
Otherwise, this hardware should be fine with this number of bodies.
Bodies are not overlapping, when they are placed in the game. But, they are stacked on top of others, as in the sideview of the game.
😕 bump 😕 Anybody know a solution for this???
Are you using a large number of joints? Perhaps you could give some code to show how you are setting up the scene.
@irresistibleforce, I'm not using any joints in my code. Basically, I've setup a world and added box2d bodies to the screen. There are no more complex operations, except that some bodies have been split into triangles to overcome box2d limitations of concave shapes and number of vertices more than 8. Other than that, it's just basic body creation. I don't know what's wrong with it. When reducing number of bodies, the frame rate is improving really good, but it's making my level design too easy.
hmm.. interesting. So about how many fixtures are there in total?
Around 110 fixtures are there in the extreme level. Other levels range from 70 to 100...

Original thread: https://box2d.org/forum/viewtopic.php?t=8671