Performance Tuning Farseer For The XBox 360

Well, it's been a week of trying to eek as much performance out of the 360 as possible. 

Turns out the compact framework used by the XBox 360 does float math a fair bit slower than .Net on Windows.  The good news is, this forced me to go through Farseer and tune the hell out of the critical performance path.  I've got most of the high impact methods tuned and will finish the rest as I come across them while building samples.

Why is this good news?  Because the engine really cruises on Windows now and it runs fast enough on the XBox to make some interesting game play.

The biggest performance bottleneck in the engine is simultaneous contacts.  Anytime a scene contains a lot of stacked bodies, performance (especially on the XBox) will need to be considered.  It is fortunate that there are a LOT of game ideas that don't require a large number of stacked bodies.

Here area a couple screens to give an idea of the performance difference (for stacked bodies) between the XBox 360 and my PC which is a Core 2 Duo, 2.13 Ghz, and 2 Gig of ram.

The physics for the scene with more stacked bodies takes ~5ms to update on my PC, the physics for scene with fewer stacked bodies takes ~5ms to update on the XBox.  The XBox can not run the larger scene.

Another way to look at it: Considering just the small scene, the PC can update the physics in less than 1ms while the XBox takes ~5ms.

CropperCapture[15] CropperCapture[14]

So, what now... well I'm back to upgrading the engine and creating samples/demos.  I'll try to get a list of the things I'm working on posted so people can track where I'm at and how much I have to go.

-Jeff