Posts

Showing posts from November, 2010

Optimizing Performance On The Xbox 360 - Part 2

In part 1 I described the reasons why Xbox 360 is slower than an equivalent PC and  some of the basic recommendations for optimizing C# code to make it run faster. In this post I will mention a few other tricks to increase performance on the Xbox 360. Structures… again. In the .NET world, objects are allocated on the heap and structures are allocated on the stack. Remember, only the heap is garbage collected, this means that structures are not subject to the expensive garbage collection operation. Allocation on the stack is basically free as we only need to increase a stack pointer and call a constructor. This means you can reduce garbage collection and increase speed by using structures instead of objects – however, you need to know the difference between the two. You should also follow the general recommendations for using structures: Small data objects (data containers) Often destroyed or created Read-only (or mostly-read) objects Reuse those objects As menti

Optimizing Performance On The Xbox 360 - Part 1

Image
After my Performance Tips and Tricks series I got a lot of requests to write a post regarding the performance on the Xbox 360 platform. I will try to focus on why Xbox 360 is slower than PC and what we can do to get around it. But first we need to underline the importance of good programming. Algorithms and datastructure complexity I’ve been on the topic of complexity before . I can’t underline how important it is that we keep the complexity of our algorithms low. If you are sorting a large dataset, make sure you use the correct algorithm and if you are sorting a small dataset (<10 items), there is another and faster algorithm. Note: If you use .Net List<T>.Sort() , it automatically chooses the best algorithm depending on your dataset. If you are using pixel perfect collision detection, perhaps you should implement a physics system that uses a polygon collision system instead. You could also implement a broad phase system to filter out collisions that you don’t nee

Farseer Physics Engine 3.1 released

Image
I’ve just packaged and released Farseer Physics Engine 3.1. It has a lot of new features and a couple of bugs have been fixed. You can see a list of changes in the new version on the downloads page .