The CPU Usage ProfilerA window that helps you to optimize your game. It shows how much time is spent in the various areas of your game. For example, it can report the percentage of time spent rendering, animating, or in your game logic. More info
See in Glossary module is divided into charts in the top half of the Profiler window, and has timeline and hierarchy views in the details pane in the bottom half of the window.
The CPU Usage Profiler module’s chart tracks the time spent on the application’s main thread.
Chart | Description |
---|---|
Rendering | How much time your application spends on rendering graphics. |
ScriptsA piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like. More info See in Glossary |
How much time your application spends on running scripts. |
Physics | How much time your application spends on the physics system. |
Animation | How much time your application spends on animating skinned meshThe main graphics primitive of Unity. Meshes make up a large part of your 3D worlds. Unity supports triangulated or Quadrangulated polygon meshes. Nurbs, Nurms, Subdiv surfaces must be converted to polygons. More info See in Glossary Renderers, GameObjectsThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info See in Glossary, and other components in your application. This also includes the time spent on calculations for systems the Animation and Animator componentsA component on a model that animates that model using the Animation system. The component has a reference to an Animator Controller asset that controls the animation. More info See in Glossary use. |
GarbageCollector | How much time your application spends running the managed garbage collector. |
VSyncVertical synchronization (VSync) is a display setting that caps a game’s frame rate to match the refresh rate of a monitor, to prevent image tearing. See in Glossary |
How much time your application spends per frame waiting for the targetFrameRate or the next VBlank to sync with. To determine the VSync value, Unity uses the QualitySettings.vSyncCount value, the target frame rate, or the default or enforced maximum VSync value of the platform your application is running on. For more information about VSync, refer to the Profiler markers documentation. |
Global IlluminationA group of techniques that model both direct and indirect lighting to provide realistic lighting results. See in Glossary |
How much time your application spends on lighting. |
UI(User Interface) Allows a user to interact with your application. Unity currently supports three UI systems. More info See in Glossary |
How much time your application spends on displaying its UI. |
Others | How much time your application spends on code that doesn’t fall into any of the other categories. This includes areas like the entire EditorLoop, or the profiling overhead when you profile in Play mode. For more information refer to Play mode and Editor samples. |
When you select the CPU Usage module, the details pane displays a breakdown of where the application spent time in the selected frame. Use the toolbarA row of buttons and basic controls at the top of the Unity Editor that allows you to interact with the Editor in various ways (e.g. scaling, translation). More info
See in Glossary at the top of the pane to navigate the views.
Property | Description |
---|---|
Timing data view dropdown | Choose to display the timing data as either a timeline or a hierarchical table. To change the display, use the dropdown in the details pane (set to Timeline by default). The following views are available:
|
Live setting | Displays data about the selected frame in real time in the module details pane when you record new data in Play mode or the Editor. By default, this setting is disabled, and the module details pane is blank when you record data. Note: This setting increases the overhead of the EditorLoop when the Profiler window is repainted. |
Thread selector (Hierarchy views only) | Use the Thread dropdown to select a specific thread, like the Main Thread or Render Thread to inspect in these views. |
Details dropdown (Hierarchy views only) | Display information about where your application calls and uses profiled functions. Choose from the following options:
|
The More (⋮) menu contains the following settings:
Setting | Description |
---|---|
Show Full Scripting Method Names | Displays the fully qualified names for all scripting methods (Assembly::Class::MethodName ). |
Show Flow events (Timeline view only) | Displays the relationship between systems, jobs, and threads. When you enable this setting, the Profiler adds white event markers to the Profiler samples that schedule jobs, or wait on scheduled jobs to complete. It also darkens unrelated samples to make it easier to visualize the sample you select. When you select a sample, the Profiler connects the relevant flow event markers together with lines. A thicker line highlights the particular flow line you select. For example, if a begin sample points to two other next samples, when you click one of the next samples, the Profiler draws a thicker line to it.The Profiler adds the following arrow types to the samples:
|
Collapse EditorOnly samples (Hierarchy views only) | Displays EditorOnly samples in the view. By default, Unity collapses all EditorOnly samples in Hierarchy views. EditorOnly samples are samples in the player loop that only happen because of Editor-only safety checks. When the samples are collapsed, their GC.Alloc value doesn’t contribute to the GC.Alloc value of their enclosing sample. For more information, refer to Play mode and Editor samples. |
When you select a sample in the Timeline view, the tooltip on the selected sample provides further details, such as the number of instances and the total time of this sample across all threads. You can select the text within the tooltip and copy it and use the buttons to interact with the sample further.
Tooltip | Description |
---|---|
Copy | Copy the call stack and the entire contents of the tooltip to your clipboard. |
Show | Select this dropdown to view the sample in different contexts:
|
The hierarchy views display the following detailed information for each item:
Column | Description |
---|---|
Total | The total amount of time Unity spent in a particular sample, as a percentage of the total frame time. |
Self | The total amount of time Unity spent in a particular sample as a percentage of the total frame time, excluding the time from sub samples. |
Calls | The 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 Alloc | How 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 ms | The total amount of time Unity spent in a particular sample, in milliseconds. Note: If your application uses the job system or multithreaded rendering, this information might be misleading, because it only contains the time Unity spent on the selected thread. To change the thread, select the Thread dropdown at the top of the Hierarchy pane. |
Self ms | The total amount of time Unity spent in a particular sample, in milliseconds, excluding the time Unity spends calling sub functions. |
Warning (⚠) | Displays how many times the application has triggered a warning during the current frame. For more information, refer to Performance warnings. |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.