Windows apps
Collapse the table of content
Expand the table of content

How to capture and analyze performance data using Windows Phone Application Analysis

[This topic contains pre-release information and is subject to change. Blank topics are included as placeholders.]

October 18, 2012

Applies to: Windows Phone 8 | Windows Phone OS 7.1

You can use the Windows Phone Application Analysis tool to improve the performance of your Windows Phone apps. You collect sample performance data in a profiling session and then view and analyze the data. You have the option of analyzing the execution performance or the memory usage of the app in a single profiling session. This topic describes how to capture execution or memory usage data and analyze it using the Application Analysis tool.

The first step in profiling your app is to capture performance data while using your app. The captured data is stored in a performance log file with a .sap extension. After you create a log file for your app, the analyzer displays detailed information about your app that you can use to make performance improvements.

To capture performance data

  1. In Visual Studio, open a Windows Phone project .

  2. Build the project.

    For optimal profiling results, you should create a release build. For more information, see How to build and deploy a Windows Phone app using Visual Studio.

  3. On the Standard toolbar, select the target device.

    For optimal profiling results, target a Windows Phone device instead of Windows Phone Emulator.

  4. On the Debug menu, select Start Windows Phone Application Analysis.

    Tip Tip:

    If you are using Visual Studio Premium or Ultimate, make sure you select Start Windows Phone Application Analysis and not Start Performance Analysis.

    A blank performance log (.sap file) displays on a tab in Visual Studio. The .sap file is named automatically using a combination of the project name and a date and time stamp. All log files for a project are stored with the project unless you delete them.

    The performance log initially displays settings that enable you to select the performance options you want to analyze.

    Note Note:

    If you do not specify a release build or do not deploy the app to a device, you will see a warning below the settings.

    The following image shows an empty performance log and the settings.

    The Windows Phone Profiler "Launch" screen
  5. In the settings, select the Execution option to analyze the performance of drawing visual items and method calls in the code.


    Select the Memory option to analyze object allocation and the use of textures in the app.

    Typically you should choose Execution unless you know you have a memory issue with your app.

  6. Optionally, you can click Advanced Settings to display more options for analyzing your app such as whether to collect cache details, whether to collect detailed performance counters and how deep in the stack to collect memory allocations for. Select any additional settings you would like for the profiling session.

  7. When you have finished making your selections, click Launch Application to start the profiling session. Your app will launch to the specified target.

  8. Use and navigate through your app like a typical user would. If there are performance problems you have previously observed in your app, such as uneven scrolling or an unresponsive user interface, make sure and use those features of your app during the profiling session. You may want to use a timer and make note of when you exercise the problem areas of your app so you can analyze these later in the performance log. The following image shows a profiling session in progress.

    The Windows Phone Profiler, "In Progress"
  9. When you have finished interacting with the app, stop the profiling session clicking Stop Profiling.

    Note Note:

    You should always stop a profiling session by clicking Stop Profiling. Stopping a profiling session by disconnecting the device or emulator can cause sampling errors.

To analyze performance data

  1. In Solution Explorer, double-click a performance log (.sap) file to open it in Visual Studio. If you just finished a profiling session, this performance log file should already be open in Visual Studio.

    The graph for the profiling session displays in Visual Studio.

  2. Use the graph to observe the frame rate for the app during the profiling session as well as its CPU usage, memory usage, storyboard, image loads and garbage collection events. For more information about the Graphs section, see Windows Phone Application Analysis.

  3. To identify specific issues with the app, select a region in the graphed timeline. Detailed information for the selected portion of the timeline will display in the performance analysis summary below the graph.

    The following image shows an example of a selected region and the results in the performance analysis section.

    Windows Phone Profiler, with highlighted timeline
  4. In the performance analysis table, you will see three types of entries identified by the following icons.

    • Information icon Information items

    • Warning icon Warning items

    • Profiler error icon Error items

  5. For each Information icon Information, Warning icon Warning, and Profiler error icon Error entry you should follow the instructions in the Observation Summary column to further investigate the source of the information, warning, or error item. These instructions will walk you through what selections to make from the Performance Warnings navigation toolbar and what to look for in the resulting view. You can click Performance Warnings in the navigation toolbar to hide the additional views and return to the performance analysis summary. The following image shows the navigation toolbar expanded to show the CPU Usage view.

    Performance Warnings navigation toolbar, expanded

    For more information about common performance issues, see How to identify and fix common performance issues using Windows Phone Application Analysis.

© 2017 Microsoft