Interpreting Frame Data

Use the Frame API to analyze code frames and identify bottlenecks in your application caused by slow or fast frame rate. To interpret the performance data provided during the frames analysis, you may follow the steps below:

  1. Analyze summary frames statistics.

  2. Analyze the timeline.

  3. Identify the hotspot function.

  4. Identify the hotspot code sections.

  1. Analyze summary frames statistics.

    Click the Summary tab to open the Summary window and analyze the Frames Rate histogram. Hover over a bar to see the total number of frames in your application executed with a specific frame rate. High number of slow or fast frames signals a performance bottleneck. Explore the data provided in the Bottom-up and Timeline panes to identify code regions with the high/slow frame rate. Try to optimize your code to keep the frame rate constant (for example, from 30 to 60 frames per second).

  2. Analyze the timeline.
    Click the Bottom-up tab to switch to the Bottom-up window and analyze the data represented in the Timeline pane.

    The Ruler Area displays blue frame markers. Hovering over a marker opens a tooltip that provides the following data:

    • Frame start time

    • Frame duration

    • Frame number

    • Name of the frame grouping domain

    • Type of the frame based on the frame rate threshold you define in the target properties.

    • Frame rate. Typically, you should keep the frame rate constant from 30 to 60 frames per second.

    The Frame Rate section displays how the frame rate is changing over time. To understand the cause of the bottleneck, identify sections with the Slow or Fast frame types and analyze the CPU Usage and Thread Concurrency data. For example, you may detect the Slow frame rate for the section with the poor CPU usage or thread contention. In this case, you may parallelize the code to utilize CPU resources more effectively or optimize the thread management.

  3. Identify the hotspot function.

    You may identify the hotspot function containing the critical frame either from the Timeline or from the Bottom-up pane:

    • From the Timeline pane, drag and drop to select the range with the Slow or Fast frame rate. VTune Amplifier highlights the selected frame in the Bottom-up pane.

    • From the Bottom-up pane, change the grouping level to Frame Domain/Frames/Function/Call Stack to group the data in the grid by Frame Domain. By default, the VTune Amplifier sorts the data by the CPU time values in the descending order. Locate the Frame Time column and click the column header to sort the grid by the Frame time metric that shows the wall time during which frames were active. Focus on the top frames with the highest Frame time values. Expand frames to see the function they belong to.

  4. Identify the hotspot code sections.

    Double-click the hotspot frame to view the source code for the function containing this frame. By default, the VTune Amplifier highlights the code line in this function that took the most CPU time to execute.

Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.