Thursday, January 21, 2010

Performance tips and tricks series

In the past I posted 4 blogs posts with ways to optimize your applications using keywords, compiler tricks and approximations. Here is a quick overview of the blog posts:

Part 1 – Common sense in application development. Use constants and loop manipulation.

Part 2 – Most commonly used keywords in C#: sealed, static, struct, ref, out and unsafe

Part 3 – Information about method inlining. Notes on virtual calls, struct arguments and exception handling. Short introduction to loop unrolling.

Part 4 – Boxing and unboxing, more on exception handling and string operations

Hopefully I will get the time to write some Xbox360 specific optimizations in the near future. I’m busy with the development of Farseer Physics Engine 3.0 at the moment, so it might take some time.

Friday, January 8, 2010

My Xbox 360 nightmares

Once upon a time an open source software developer wrote a physics engine for the .net platform. (Let us call him me!) Because of many requests from his users, he targeted Xbox360 as one of the supported platforms.

The many users of his free physics engine felt generous and donated a Xbox360 so that he could optimize the physics engine for that platform. Overjoyed by the offer, he accepted and could not wait to see what kind of machine the Xbox360 really was.

Nightmare number 1
After paying for a cheap Xbox360 Arcade on  the Internet he waited almost a month before realizing something was wrong. After 5 emails to the retailer and several weeks later, the order was finally canceled and he went on another journey to find a cheap retailer that would provide him with a brand new Xbox360.

Nightmare number 2
After his first experience he checked out all the possible references to the new shop as he possible could. Customer comments, google ratings and even the famous E-Mark. Little did he know that the retailer just repeated his experience from the first nightmare. After several weeks, he finally got his money back again.

The dream of a Xbox360
Eager to try off a Xbox360, he went to a store with a brand new Xbox on display. He walked to the customer information desk, only to be informed that they had no Xbox360 left in the store. Feeling a taste of defeat he went outside the store to think about where to go next…

WAIT someone said from inside the store… the developer turned around to see a guy with a big greenish box with XBOX 360 written on the side. Renewed with joy and happiness he went to the checkout to get his brand new Xbox360 home. After connecting everything and make it look like the alter in a church, the Xbox360 turned on with all the glowing colors of 1080p HD.

Nightmare number 3
Like a kid at Christmas time the developer turned on his computer and tried to connect to the Xbox360. Little did he know that it required an application that could be found in the Game Markedplace, and to get the application, he had to pay 1/2 the price of the Xbox he just bought. Thinking that nothing should stand in his way of getting it to work, he paid the amount necessary and started waiting. After waiting for what seemed liked ages, the account was finally recognized in the Xbox system of magic and he could deploy games with ease.

Nightmare number 4
Getting tired of running the same physics simulation 100 times in a row and feeling curious about what else this new fancy thing could do, he decided to play some of the games that physics engine users had created. Clicking on the “free trial” link next to one of those games left him with a message saying “You have to be a gold member to play this game”… thinking that gold membership must be the Xbox world’s key to unlock all doors, he bought a gold membership and clicked the same link again. This time he got a new message saying: “This game is not available in your region”… Fury with rage he went to bed, cursing the name of Xbox while trying to sleep.

Back to the real world
Well, That was all I had to go though… only to discover that I had no way of playing the games that used the fruits of my labor. Waiting so long to get a Xbox360, only to find out I’m left with a useless mini computer with no games on it and a deep hole in my pocket. I hope that they are going to put Denmark on the “allowed region” list soon or my expensive gold membership is going to be a total waste. Thanks for nothing so far Microsoft.