22

Visual Studio diagnostics tools for XAML-based Windows Store apps

  • Upload
    adele

  • View
    94

  • Download
    0

Embed Size (px)

DESCRIPTION

Visual Studio diagnostics tools for XAML-based Windows Store apps. Pratap Lakshman Senior Program Manager 3-322. Agenda. Performance is a feature. Pillars of performance. Diagnosis with Visual Studio. Summary. Great performance motivates app purchases. - PowerPoint PPT Presentation

Citation preview

Page 1: Visual Studio diagnostics tools for XAML-based Windows Store apps
Page 2: Visual Studio diagnostics tools for XAML-based Windows Store apps

Visual Studio diagnostics tools for XAML-based Windows Store appsPratap LakshmanSenior Program Manager3-322

Page 3: Visual Studio diagnostics tools for XAML-based Windows Store apps

Performance is a feature.Pillars of performance.Diagnosis with Visual Studio.Summary.

Agenda

Page 4: Visual Studio diagnostics tools for XAML-based Windows Store apps

User implicitly relates consistent performance with app quality.

Great performance motivates app purchases

App Fr

eezes

Crashe

s

Slow Resp

onsiv

eness

Heavy

Battery

Usage

0%10%20%30%40%50%60%70%80%

Reasons of Bad Reviews

Source: http://www.businessnewsdaily.com/

Page 5: Visual Studio diagnostics tools for XAML-based Windows Store apps

Fast.“Snappy” user interaction.Relation: app launch, navigating pages.Fluid.“Smooth” user interaction.Relation: scrolling, panning, animation.Efficient.System “citizenship”.Relation: battery life, memory usage.

Fast, fluid & efficient, are the dimensions of performance the app user perceives.

Pillars of performance

Page 6: Visual Studio diagnostics tools for XAML-based Windows Store apps

XAML UI responsiveness.Relation: fast, fluid.CPU sampling.Relation: fast, fluid.Same as the experience shipped in Visual Studio 2012.Energy consumption.Relation: efficient.Managed memory dump analysis.Relation: efficient.Designed for production diagnostics scenarios.

Post mortem profile data analysis.Supports remote profiling.“Performance and diagnostics hub” serves as the single entry point for the profilers.

…and their tooling in Visual Studio

Page 7: Visual Studio diagnostics tools for XAML-based Windows Store apps

Load/parse/build element tree/object model.Formatting (styles)/layout.Compute formats, apply templates.Measure and arrange.Build visual tree for hit-testing and rasterization.Render visible objects into primitives.Display/rasterization.Walk visual tree, rasterize to target surfaces.Composition.Independent animations, walk visual tree, to render to primary and present.

The pipeline.XAML operations broken down into frames.UI thread and composition thread can submit frames.

Fast, fluid—influence of XAML, app code

Page 8: Visual Studio diagnostics tools for XAML-based Windows Store apps

Parsing.Files parsed (time to parse, number of times parsed, number of elements).Load on the UI thread.Templates (multiplied).Content virtualization.Complex layout.Dependent animations.Load on the composition thread.Independent animations.Overdraw.App code (specifically, per frame callbacks).

Reduce complexity!Update screen content in ‘vsync’ cadence (16.7ms).App code execution can happenduring frame preparation time.

Fast, fluid—influence of XAML, app code

Page 9: Visual Studio diagnostics tools for XAML-based Windows Store apps

Demo: XAML UI responsiveness tool

Page 10: Visual Studio diagnostics tools for XAML-based Windows Store apps

Fast—analysis

Page 11: Visual Studio diagnostics tools for XAML-based Windows Store apps

Fast—analysis

Page 12: Visual Studio diagnostics tools for XAML-based Windows Store apps

Demo: CPU sampling tool

Page 13: Visual Studio diagnostics tools for XAML-based Windows Store apps

Very difficult to attribute energy usage to every resource accurately enough to make it actionable.Too many variables. That is not we are trying to do here.Empirically, CPU, display, network resources dominate.The tool discovers energy hungry segments of an app scenario.…without imposing the use of power metering hardware.…by mapping resource usage to estimated energy using a software power model.Optimize the resource usage to make the apps more energy efficient.

CPU, network, display are the resources that tend to dominate energy consumption.

Efficient—influence of system resource usage

Page 14: Visual Studio diagnostics tools for XAML-based Windows Store apps

CPU power state transitions as load varies.Display power varies by.HW implementation (smart vs. dumb LCD vs. OLED).User settings (brightness).Design choices (color content, animations).Network.Wired ≠ Wireless.Wi-Fi ≠ 2G, 3G, 4G(power management by Radio Resource Controller).Memory consumption.

Reduce CPU usage.Animations are not free. White/Bright pixel more expensive on OLED.“Network” provides hidden optimization opportunities.Look out for managed memory leaks.

Efficient—influence of CPU, display, network

Page 15: Visual Studio diagnostics tools for XAML-based Windows Store apps

Sample RRC state machine.RRC intended to support stable, scalable performance, and be battery-aware.

Efficient—influence of the Network RRC

Page 16: Visual Studio diagnostics tools for XAML-based Windows Store apps

Every data transfer will cycle the radio to high power, and reset the timeouts.

Efficient—influence of the Network RRC

Page 17: Visual Studio diagnostics tools for XAML-based Windows Store apps

Demo: energy consumption tool

Page 18: Visual Studio diagnostics tools for XAML-based Windows Store apps

Demo: managed memory dump analysis

Page 19: Visual Studio diagnostics tools for XAML-based Windows Store apps

Performance is a feature. Need to balance it across multiple dimensions.Fast, fluid & efficient are the pillars spanning the dimensions of time, energy & space.Need to manage influence of XAML, app code & system resources.Performance and Diagnostics Hub.Single point of entry for the performance tools.Post-mortem analysis.Supports remote profiling.End to end lifecycle tooling.Design-time to production.

Need to consider performance “holistically”.

Summary

Page 20: Visual Studio diagnostics tools for XAML-based Windows Store apps

ResourcesRelated sessions.WCL-157: XAML Performance Fundamentals.WCL-158: Dramatically increase performance when users interact with large amounts of data in GridView and ListView.WCL-164: What’s new in XAML.Dev-12: developing high performance websites and modern apps with JavaScript performance tools.Dev-16: diagnosing issues in JavaScript Windows Store Apps with Visual Studio.Performance documentation.http://aka.ms/fastxamlThank you!

Page 21: Visual Studio diagnostics tools for XAML-based Windows Store apps

Evaluate this session

Scan this QR code to evaluate this session and be automatically entered in a drawing to win a prize!

Page 22: Visual Studio diagnostics tools for XAML-based Windows Store apps

© 2013 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.