Documentation

Unity Engine

Download Unity

Unity Engine

CPU Usage Profiler module Hierarchy reference

Explore the Hierarchy, Inverted Hierarchy, and Raw Hierarchy views to examine sample timings and managed allocations one thread at a time.
Read time 3 minutesLast updated 2 days ago

In the Timing data view dropdown of the CPU Usage Profiler module, you can select the following hierarchy views:
  • Hierarchy
  • Inverted Hierarchy
  • Raw Hierarchy
These views display profiling data one thread at a time and only display a sample's duration. The Timeline view also displays when each sample occurs. For more information, refer to Hierarchy views.

Profiler window with a frame in the CPU Usage Profiler module selected. The Hierarchy view is selected in the details pane.

Module details pane toolbar

In addition to the default controls at the top of the module details pane, you can configure the information displayed in these views.

Property

Description

Thread selectorSelect a specific thread to inspect the collected data for.
Details dropdownDisplays information about where your application calls and uses profiled methods in the right panel. Choose from the following options:
  • No Details: Doesn't display any extra information.
  • Related Data: Displays a list of the
    UnityEngine.Object
    instances associated with the sample through a
    Begin
    overload.
  • Calls: Displays the methods that call the selected sample and the methods that it calls.

Hierarchy view columns

The hierarchy views display the following detailed information for each item:

Column

Description

TotalThe total amount of time Unity spent in a particular sample, as a percentage of the total frame time.
SelfThe total amount of time Unity spent in a particular sample as a percentage of the total frame time, excluding the time from child samples.
CallsThe number of calls made to this sample in this frame. In the Raw Hierarchy view, the values in this column are always
1
because the Profiler doesn't merge the hierarchy of samples.
GC AllocHow much scripting heap memory Unity has allocated in the current frame. The garbage collector manages the scripting heap memory.

For more details about the managed heap, refer to the documentation on Understanding Automatic Memory Management.
Time msThe total amount of time Unity spent in a particular sample, in milliseconds.

Note: If your application uses the job system or multithreaded rendering, this value doesn't include time that Unity spends on other threads, only on the selected thread. To change the thread, use the thread selector at the top of the Hierarchy pane.
Self msThe total amount of time Unity spent in a particular sample, in milliseconds, excluding the time Unity spent in child samples.
Warnings (⚠)Displays how many times the application has triggered a warning during the current frame. For more information, refer to Performance warnings.
The Related Data view lists the metadata associated with the selected sample, which can include a
UnityEngine.Object
associated with it. For any metadata entry that isn't associated with a
UnityEngine.Object
, the name displays as N/A in this panel. When you select an N/A entry, the Profiler displays the metadata, including the call stack in the bottom half of the module details pane.
Some samples that Unity reports have built-in metadata, such as
Camera.Render
samples linked to the GameObject with the
Camera

?

component that does the rendering. Unity reports these objects via their instance ID and resolves them to a name in the Profiler window, if you profile in Play mode. When you select one of these objects, Unity tries to find the object via the scene hierarchy and ping it.
Because the association uses the instance ID, pinging only works when you profile your application in Play mode, and for as long as the object still exists. For
GC.Alloc
samples, this view displays a list of N/A items, one for each allocation that happened at this hierarchy level, with the size of the allocation listed in the GC Alloc column.

Additional resources