220 likes | 407 Views
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.
E N D
Visual Studio diagnostics tools for XAML-based Windows Store apps PratapLakshman Senior Program Manager 3-322
Agenda • Performance is a feature. • Pillars of performance. • Diagnosis with Visual Studio. • Summary.
Great performance motivates app purchases • User implicitly relates consistent performance with app quality. Source: http://www.businessnewsdaily.com/
Pillars of performance • Fast, fluid & efficient, are the dimensions of performance the app user perceives. • 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.
…and their tooling in Visual Studio • Post mortem profile data analysis. • Supports remote profiling. • “Performance and diagnostics hub” serves as the single entry point for the profilers. • 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.
Fast, fluid—influence of XAML, app code • The pipeline. • XAML operations broken down into frames. • UI thread and composition thread can submit frames. • 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.
Fast, fluid—influence of XAML, app code • Reduce complexity! • Update screen content in ‘vsync’ cadence (16.7ms). • App code execution can happenduring frame preparation time. • 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).
Efficient—influence of system resource usage • CPU, network, display are the resources that tend to dominate energy consumption. • 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.
Efficient—influence of CPU, display, network • 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. • 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.
Efficient—influence of the Network RRC • Sample RRC state machine. • RRC intended to support stable, scalable performance, and be battery-aware.
Efficient—influence of the Network RRC • Every data transfer will cycle the radio to high power, and reset the timeouts.
Summary • Need to consider performance “holistically”. • 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.
Resources • Related 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/fastxaml • Thank you!
Required Slide *delete this box when your slide is finalized Your MS Tag will be inserted here during the final scrub. Evaluate this session • Scan this QR codeto evaluate this session and be automatically entered in a drawing to win a prize!