Hi Guys,
I am developing a game for the XNA platform using the Box2dx port of box2d. However I'm having some serious performance issues on the xbox 360.
With about 50 shapes and 20 revolute joints, the performance drops to 1 frame every couple of seconds on the xbox, but runs at a steady 60fps (the max) on my computer (2.2ghz processor).
I used the awesome CLR Profiler to optimise Box2dx memory. I introduced memory pools, turned simple classes into structs and replaced method local arrays with static arrays (so its not allocated on the heap every time). This reduced my GC time on the Xbox from about 300ms a second to 40ms (GC latency * GC collections). But only resulted in a small increase performance.
I also tried inlining the maths and vector methods in the tight loops, to reduce struct copying and method invocation overhead. This (unsurprisingly really) resulted in no performance increase, I guess the JIT is inlining most of it anyway.
So I'm running out of ideas. I was expecting it to be slower on the xbox, but 60x slower!?
Has anyone here managed to get good performance on the xbox 360? What tricks did you use? Am I just missing the "be fast" option somewhere?
Thanks!
I am developing a game for the XNA platform using the Box2dx port of box2d. However I'm having some serious performance issues on the xbox 360.
With about 50 shapes and 20 revolute joints, the performance drops to 1 frame every couple of seconds on the xbox, but runs at a steady 60fps (the max) on my computer (2.2ghz processor).
I used the awesome CLR Profiler to optimise Box2dx memory. I introduced memory pools, turned simple classes into structs and replaced method local arrays with static arrays (so its not allocated on the heap every time). This reduced my GC time on the Xbox from about 300ms a second to 40ms (GC latency * GC collections). But only resulted in a small increase performance.
I also tried inlining the maths and vector methods in the tight loops, to reduce struct copying and method invocation overhead. This (unsurprisingly really) resulted in no performance increase, I guess the JIT is inlining most of it anyway.
So I'm running out of ideas. I was expecting it to be slower on the xbox, but 60x slower!?
Has anyone here managed to get good performance on the xbox 360? What tricks did you use? Am I just missing the "be fast" option somewhere?
Thanks!