, which are especially useful for identifying a long latency activity.
You may use the
Frame API to mark the start and finish of the code regions executed repeatedly (
) in such applications as simulators with a time step loop, computations with a convergence loop, game applications computing next graphics frame, and so on.
analyzes the marked code regions and identifies 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:
. 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.
automatically sets up thresholds for slow and fast frame rate. But you may change them, if needed, by dragging the slider at the bottom of the histogram. The thresholds you set will be automatically applied to all subsequent results for this project.
This grouping displays frame analysis metrics including the Frame Time that is the wall time during which frames were active. Focus on the frames with the highest Frame Time values. Expand a frame domain node to see frames grouped by frame duration. You may select slow frames, right-click and select
Filter In by Selection
to filter out all the data other than slow frames in this domain. Then you may group the data back by
to see the functions that took most of the time in these slow frames:
Analyze the Timeline
window, analyze the frame data represented in the
pane. If you filtered the grid by slow frames, the Timeline data is also automatically filtered to display data for the selected frames:
The scale area displays frame markers. Hovering over a marker opens a tooltip with details on frame duration, frame rate and so on.
band 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
data. For example, you may detect the Slow frame rate for the section with the poor CPU utilization or thread contention. In this case, you may parallelize the code to utilize CPU resources more effectively or optimize the thread management.
To identify a hotspot function containing the critical frame from the Timeline view, select the range with the Slow or Fast frame rate.
highlights the selected frame in the
Identify the Hotspot Code Sections
Double-click a critical function executing a slow/fast frame to view its source code. By default, the
highlights the code line in this function that took the most CPU time to execute.