21

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

Peter O.
  • 32,158
  • 14
  • 82
  • 96
Boryana Miloshevska
  • 2,730
  • 16
  • 17
  • I've written a successful app for the iPhone and the only two performance optimization that I had to implement were not to load too much data over the Internet at once and to load the images for a huge list asynchronously. Now I'm implementing the same application for Phone 7 and I had to realize that Phone 7 has a lot of built-in components with performance problems (list box, progress bar, complex layouts etc.). Unfortunately, this question here makes a lot of sense. – Codo Feb 06 '11 at 16:28
  • According to the FAQ `Expert programmers interested in professional discussions on software development` this question belongs to programmers. Also mentioned in the FAQ: `I would like to participate in a discussion about ______` should not be asked here... – WarrenFaith Feb 06 '11 at 19:54
  • 3
    This should be a Community Wiki post. You should also at least have some answers. FOr an example, see any one of the "Getting Started" pages here on SO. http://stackoverflow.com/questions/3402466/getting-started-with-windows-phone-7 – ctacke Feb 06 '11 at 20:28
  • It's a good idea to use an automatic code profiler to locate the performance hotspots in your code. For WP7 there is currently only one profiler available, the EQATEC Profiler (http://www.eqatec.com). – Richard Flamsholt Feb 09 '11 at 21:27

3 Answers3

1

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.
Lukasz Madon
  • 14,664
  • 14
  • 64
  • 108
1

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.

Stan
  • 746
  • 1
  • 17
  • 35
-1

I found this some days ago WP7 best practices - Performance

Its mostly commented links to articles (some of them mentioned before) and sources (like Jeff Wilcox Performance Progress Bar).

And remember: Listboxes are like kryptonite to WP7 performance =)

FrankKrumnow
  • 501
  • 5
  • 13