Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Microsoft Silverlight Performance on Windows Phone

Microsoft Silverlight Performance on Windows Phone

Presented at TechEd Middle East 2011

Daron Yondem

March 08, 2011
Tweet

More Decks by Daron Yondem

Other Decks in Programming

Transcript

  1. 8 – 10 March 2011 | Dubai, UAE

    View Slide

  2. 2
    Level 300 sessions cover advanced material and assume
    an in-depth understanding of features in a real-world
    environment, and strong coding skills.
    These sessions provide you with a detailed technical
    overview and real-life experiences of a subset of product or
    technology features, covering architecture, performance,
    migration, deployment, and development.

    View Slide

  3. 8 – 10 March 2011 | Dubai, UAE
    Daron Yondem
    Chief Architect | DEVELOAD Software
    Microsof Regional Director
    Silverlight MVP
    Microsoft Silverlight Performance on
    Windows Phone
    SESSION CODE: WPH303

    View Slide

  4. It’s made for performance!

    View Slide

  5. Threading

    View Slide

  6. UI THREAD
    Inputs
    Touch
    Layout
    Networking
    User Code
    PerFrame
    Callbacks

    View Slide

  7. Render Thread
    (Composition Thread)
    Double Animations
    Render Transforms
    Perspective
    Transforms
    Rectangular
    Clips
    Opacity

    View Slide

  8. Worker Threads
    User Code
    User Code
    User Code User Code
    User Code

    View Slide

  9. EMULATOR!
    Love OR Hate?

    View Slide

  10. EMULATOR!
    Uses GPU on PC
    More CPU than Device
    Requires DX10

    View Slide

  11. USE THE DEVICE!!!!

    View Slide

  12. PERFORMANCE COUNTERS

    View Slide

  13. Application.Current.Host.Settings.
    EnableFrameRateCounter = true;
    Fillrate

    View Slide

  14. Application.Current.Host.Settings.EnableRedrawRegions = true;

    View Slide

  15. Application.Current.Host.Settings.EnableCacheVisualization = true;

    View Slide

  16. Performance Strategy
    Minimize UI Thread Work
    Leverage Off-Thread
    Use the GPU
    Less is more!

    View Slide

  17. CacheMode = BitmapCache
    PerFrameCallback

    View Slide

  18. Visibility OR Opacity?
    De

    View Slide

  19. JPEG or PNG?
    Faster Decoding
    Opacity

    View Slide

  20. XAML or Pictures?

    View Slide

  21. App Start-Up
    Delay Loading the Unneeded!
    Include applicationsplashscreen.jpg
    Use a splash screen

    View Slide

  22. DON’T!
    Non-rectangular clips Large textures
    ( > 2K pixels either way)
    Not simple animations
    (e.g. ColorAnimation)
    Opacity mask

    View Slide

  23. It’s made for performance!

    View Slide

  24. Tips & Tricks
    Loading Large Images?
    HttpWebRequest
    instead of WebClient
    PerformanceProgressBar
    Minimize the Code in
    Constructors and Loaded Events
    Split across DLLs

    View Slide

  25. 25
    Related Content
    • Web Developers Community Chat
    Next!, 3.30pm, Yellow Theater 2

    View Slide

  26. 8 – 10 March 2011 | Dubai, UAE
    Complete an
    evaluation on
    CommZone and enter
    to win an HP!

    View Slide

  27. Daron Yondem
    [email protected]
    http://daron.yondem.com
    THANKS!
    8 – 10 March 2011 | Dubai, UAE
    All samples on my blog! Full Source Code!

    View Slide

  28. © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
    The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the
    accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

    View Slide