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


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.


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.

  • 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 =)

    链接地址: http://www.djcxy.com/p/95970.html

    上一篇: .NET Compact Framework应用程序是否与Windows Phone 7兼容?

    下一篇: 制作Windows Phone 7应用程序时有哪些性能提示?