Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are some performance tips when making Windows Phone 7 applications?

As performance is very important for Windows Phone 7 application development I am starting this question so that we can collect here some helpful performance tips.

General:

Performance Considerations in Applications for Windows Phone

Articles:

Performance Tips when creating WP7 apps

Performance of Windows Phone 7 Applications

Performance Considerations for Windows Phone 7 Games

Videos:

Optimizing Performance for Silverlight Windows Phone 7 Applications

Windows Phone 7 Jump Start (Session 17 of 19): Optimizing for Performance

Silverlight Firestarter 2010 - Performance Tips for Silverlight Windows Phone 7

Samples:

Creating High Performing Silverlight Applications for Windows Phone Samples

like image 926
Boryana Miloshevska Avatar asked Feb 06 '11 15:02

Boryana Miloshevska


2 Answers

The #1 performance enhancer I've found for my apps, especially for animations that use the UI thread, is to manually set BitmapCache for all UIElements. This significantly improves all animation.

like image 65
Stan Avatar answered Oct 20 '22 07:10

Stan


General

  • If your app loads very fast get rid
    off the spash screen.
  • Code generation in the compact framework is not the same as Windows’ code. Jitter is optimized to run fast, not to produce the fastest code.
  • Property is just a function for .Net CF.

Silverlight

  • Take as much as you can from Compositor Thread (for callback animations use BitmapCache).
  • Use Canvas or custom popup instead of default one (Popup class) – lack of hardware acceleration.

XNA

  • Use DXT format for textures and pack them into 1 file (faster loading and fewer GPU texture switches).
  • For things like game stats avoid using strings( immutable). SpriteBatch.DrawString can take a StringBuilder directly for drawing text.
  • Avoid using/abusing LINQ and foreach (it may causes garbage). Use Jagged arrays( arrays of arrays) instead of 2d arrays.
like image 33
Lukasz Madon Avatar answered Oct 20 '22 07:10

Lukasz Madon