Sunday 5 October 2008

I Love Silverlight RC0 for Performance

One of the issues that I was having with the Silverlight Spectrum emulator in Beta 2 was the performance.

Sometimes it would be okay, sometimes it would be really jerky.  There was definitely issues to do with what was going on in your machine and other processes.

With RC0 they introduced the CompositionTarget.Rendering event, which is an event that occurs just before rendering of the UI, which makes this much better to use for scenarios such as Game Loops or for rendering of emulators (which is very similar to a game loop).  This is a much better method than using a Timer or a Storyboard.

Bill Reiss has a great article on this.

To be honest even without this feature the performance feels so much better.  Although I'm not a game writer in any shape or form (not that game writers have particular shapes), my experience with from writing the Silverlight version of the Spectrum Emulator and with my general Silverlight experience I can tell this will be a great platform for writing casual games :)

4 comments:

Anonymous said...

Does anybody know if the RC0 code is a debug build, or a release build?

If it's a debug build, we could see even more performance increases in the RTM/RTW version.

Anonymous said...

RC0 should be release candidate. It should be release build...not sure :)

chrishayuk said...

I take your point but still I can see for my scenarios (i.e. the emulator my performance issues have been resolved), so I'm excited that RC0 sorts that out.

And that gives me a lot of confidence since it's only a few weeks until release time

Gollum (Julien Frelat) said...

Tips to optimize even more the performance of your emulator:

- Instead of calling Z80 Execute() for each cycle, burn cycles inside Z80 Execute() itself using a loop. This will speed up a lot your Z80 core (MAME's Z80 core works like this).

- Joe Stegman's technique is interesting but you may find a slightly more optimized version on www.nokola.com.

I used these techniques to have a full-speed News arcade driver game working while experimenting with Silverlight at the beginning (http://www.innoveware.com).