The CPU Usage Profiler displays where time is spent in your game. When it is selected, the lower pane displays hierarchical time data for the selected frame. See documentation on the Profiler Window to learn more about the information on the Profiler timeline.
Drag chart labels up and down to reorder the way the CPU chart is stacked.
When an item is selected in the lower pane, its contribution to the CPU chart is highlighted (and the rest are dimmed). Clicking on an item again de-selects it.
In the hierarchical time data, the Self column refers to the amount of time spent in a particular function, not including the time spent calling sub-functions. In the screenshot above, 41.1% of time is spent in the Camera.Render
function. This function does a lot of work, and calls the various drawing and culling functions. Excluding all of these functions, only 2.1% of time is spent in the Camera.Render
function itself.
The Time ms and Self ms columns show the same information, but presented in milliseconds. Camera.Render
takes 0.01ms, but including all the functions it calls, 0.21ms are consumed. The GC Alloc column shows how much memory has been allocated in the current frame, which is later collected by the garbage collector. Keep this value at zero to prevent the garbage collector from causing hiccups in your framerate.
The Others
section of the CPU profiler records the total of all areas that do not fall into Renderer, Scripts, Physics, Garbage Collection or VSync. This includes Animation, AI, Audio, Particles, Networking, Loading, and PlayerLoop.
The descriptions below provide a brief account of what each of the various high-level Physics Profiler markers mean:
FixedUpdate
. This updates the present state of the physics by instructing the physics engine (PhysX) to run its simulation.FixedUpdate
. This is where all the non-cloth physics jobs are processed. Expanding this marker shows low-level detail of the work being done internally in the physics engine.FixedUpdate
. This is where all the cloth physics jobs are processed. Expanding this marker will show low level detail of the work being done internally in the physics engine.FixedUpdate
. This is where the results of the physics simulation are collected from the physics engine.FixedUpdate
. This is where all the physics bodies have their positions and rotations updated as well as where messages that communicate these updates are sent.FixedUpdate
. This stage is run once the physics FixedUpdate
has concluded, and is where all the various stages of responding to the results of the simulation are processed. Contacts, joint breaks and triggers are updated and messaged here. There are four distinct sub stages:
FixedUpdate
. This is where OnTriggerEnter
and OnTriggerExit
events are processed.FixedUpdate
. This is where OnTriggerStay
events are processed.FixedUpdate
. This is where OnCollisionEnter
, OnCollisionExit
and OnCollisionStay
events are processed.FixedUpdate
. This is where updates and messages relating to joints being broken is processed.Update
. This is where updates relating to cloth and their skinned meshes are made.Update
. This stage deals with the interpolation of positions and rotations for all the physics objects.There are some common performance issues the CPU Profiler is able to detect and warn you about. These appear in the Warning column of the lower pane, when viewing the CPU Usage.
The specific issues the Profiler can detect are:
In the screenshot above, the Profiler is showing the Static Collider.Move warning. The Warning column shows that this warning has been triggered 12 times in the current frame. The term “Delayed Cost” means that although the entry in the Profiler may show a low cost (in this case 0.00ms), the action may trigger more system-demanding operations later on.