The presentation focused on performance challenges I've come across when working on real-world WP7 applications using Silverlight. These challenges include optimizing startup time of applications, using ListBox with a large number of items, serialization / deserialization, working with images, accessing the network and realtime drawing on the screen.
7. Visiblox Charts for WP7 Challenges Avoiding overloading of the UI thread Realtime drawing on the screen How fast can you draw on the phone? Memory Leaks Data binding DPs
14. ListBox Cool in the beginning Rusty when you start adding stuff Awfully slow when you start tweaking visuals Pain to make it half as fast as on the iPhone
15. ListBox Slow with > 50-200 elements Virtualized, but…. Several workarounds Windows Phone Team: ListBox best practices 3rd party Listbox (Telerik) Implement paging
16. Emulator vs Physical Device Emulator usually 2-5x times faster GPU intensive tasks: emulator can be slower Test (frequently) on the device
22. Image Do’s and Don’t‘s Fast (with BitmapCache): Transforms: Scale, Rotate, Translate Opacitiy change Clipping region change Slow Changing image with / height OpacityMask Non-rectangular clipping areas Jpegs are (somewhat) faster than pngs
24. Avoid Overloading the UI Thread Use BackgroundWorker Throttle calls to UI while it’s busyvia the “render loop”: E.g a chart is redrawn whenever the Zoom changes A chart redraw takes 100ms The Zoom is changed at 0ms, 40ms, 80ms, 120ms The chart will still be drawing at 40ms & 80ms!
25. Rendering Real-Time Lightweight vs heavyweight elements Shapes vs Controls vsUserControls Drawing is more expensive than redrawing Reuse existing elements WriteableBitmap & WriteableBitmapEx Working with large Paths: buggy, slow
26. Extreme Optimalizations Data Binding Avoid when there are thousands of objects Takes up memory & notifications may fire too often DPs Only use if needed Slow to read cache in CLR properties
28. Closing Thoughts Use the performance counters Performance can be optimized (or you can always cut features…) Test, test, test - on a device! MIX 2011 – performance tool?