1 / 23

Advanced Windows Presentation Foundation Application Performance Tuning and Analysis

CL11. Advanced Windows Presentation Foundation Application Performance Tuning and Analysis. Bart J.F. De Smet and Eric Harding Software Development Engineers Microsoft Corporation { bartde,erichar }@microsoft.com blogs.bartdesmet.net/ bart.

imala
Download Presentation

Advanced Windows Presentation Foundation Application Performance Tuning and Analysis

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CL11 Advanced Windows Presentation Foundation Application Performance Tuning and Analysis Bart J.F. De Smet and Eric Harding Software Development Engineers Microsoft Corporation {bartde,erichar}@microsoft.com blogs.bartdesmet.net/bart

  2. Unified presentation model for Windows applications, web applications, graphics/media/animation • Integrated, vector-based compositing engine • Native support for advanced input • Support for declarative programming

  3. <Button Width="100px"> OK <Button.Background> LightBlue </Button.Background> </Button> Button b1 = new Button(); b1.Content = "OK"; b1.Background = new SolidColorBrush(Colors.LightBlue); b1.Width = 100; Dim b1 As New Button b1.Content = "OK" b1.Background = New SolidColorBrush(Colors.LightBlue) b1.Width = 100 • Markup for Windows • Build applications in simple declarative statements • Easy to learn, write, and read • Code and content are separate • Streamline collaboration between designers and developers • Easy for tools to consume and generate

  4. WPF = Designer + Developer • Resource constraints • Drowning in effects • Excessive use of images • “Rich” templates • Loaded modules • Startup time • Memory leaks • Large element count Composition = Power

  5. Performance General Truth

  6. FishbwlA sample by uxlabs@Microsoft • Dive into Facebook!Fishbowl bringsFacebook to your desktop. • Stay Connected • View and Share Photos • Explore and Organize • Ready for Windows 7 • WPF 3.5 SP1 Application • www.fishbowlclient.com • www.codeplex.com/fishbowl

  7. Fishbowl demo Bart J.F. De Smet Casual Application Developer (CAD) Windows Presentation Foundation

  8. Taming Memory Usage demo Eric Harding Performance Guru (PG) Windows Presentation Foundation

  9. Performance Checklist • Image size • Memory leaks • Element count Memory • Image size • Size in memory! • Managed leaks • Allocation stack • (GC) root path • Element count • Virtualization Cold start Warm start Runtime

  10. Cold Start demo Eric Harding Performance Guru (PG) Windows Presentation Foundation

  11. Performance Checklist • Disk I/O • Module loads • NGen Memory • All about disk I/O • Modules • Need dependencies? • Loaded at JIT time • Beware of inlining • NGen • I/O versus CPU (JIT) • Better for warm start Cold start Warm start Runtime

  12. Warm Start demo Eric Harding Performance Guru (PG) Windows Presentation Foundation

  13. Performance Checklist • Avoid blocking • Delay work • Perceived perf Memory • All about CPU time • Avoid blocking • Delay work if possible • Incremental loading • Perception = key • Splash screen • Transition effects Cold start Warm start Runtime

  14. Runtime demo Eric Harding Performance Guru (PG) Windows Presentation Foundation

  15. Performance Checklist • Excessive *.* • Beware of IRTs • Eventing Memory • IRTs • Effects, clips, opacity, opacity mask • Bitmap effects (v3.x) • Element count • Input and routed events • In .NET 4.0 • Cache composition Cold start Warm start Runtime

  16. Runtime Best Practices • Don’t block the UI thread • Virtualize when needed • UI virtualization • Data virtualization • Freeze your freezables! • No change notification callbacks • Hardware versus software • RDP, virtual machines, old hardware • RenderCapability.Tier • Reduce frame rate, animations, 3D

  17. Lessons Learned • Image size • Memory leaks • Element count Cold start Warm start Runtime Memory • Avoid blocking • Delay work • Perceived perf • Excessive *.* • Beware of IRTs • Eventing • Disk I/O • Module loads • NGen Composition + Measurement = Power

  18. Resources • Windows SDK Perf Tools • bing.com/search?q=windows+sdk • SysInternals tools • www.sysinternals.com • SciTech .NET Memory Profiler • www.memprofiler.com • WPF performance @ MSDN • bing.com/search?q=wpf+performance+msdn • Performance Blogs • WPF – blogs.msdn.com/jgoldb • .NET – blogs.msdn.com/ricom

  19. Stay in Touch Q & A Come and see us @ Ask The Experts Mail us

  20. YOUR FEEDBACK IS IMPORTANT TO US! Please fill out session evaluation forms online at MicrosoftPDC.com

  21. Learn More On Channel 9 • Expand your PDC experience through Channel 9. • Explore videos, hands-on labs, sample code and demos through the new Channel 9 training courses. channel9.msdn.com/learn Built by Developers for Developers….

More Related