Performance issue in 2.2.1?

After experiencing some issues with bodies occasionally sticking to kinematic bodies in v2.1.2 I upgraded Box2D to v2.2.1

While I was glad to see that the issue had been fixed, when I loaded another level that features a large amount of bodies I noticed significant performance hit, halving the frame-rate. While the bodies are asleep they still seem to be draining on the CPU. Is there any way I could prevent this from happening?

Any advice would be greatly appreciated.

EDIT: Or it seems that bodies won't sleep when they are held by a Weld joint?
You can use the debug draw to see what is awake. The CPU with everything sleeping should be low unless you have 10k+ bodies. After that you will start to see the expense of list traversal.

Also, make sure you don't have many bodies overlapped at a single location, leading to N*N collisions.
Thank for the reply, and great job on Box2D.
All of the bodies seem to be awake in debug draw. There doesn't seem to be any bodies overlapping. It just seems strange that the same scene is causing all of the bodies to be awake in 2.2.1 and not in 2.1.2. I'm going to try and exclude collisions between the bodies while they're connected to see if that helps but I thought I should let you know.
The ApplyForce type of functions might be waking the bodies.
I've checked and there's no force being applied to the bodies. I think that 2.2.1 counts bodies as colliding when they are close to each other. Thanks for the help 🙂

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