Play mode and Editor profile samples
Understand the difference between profiling data collected in Play mode and the data collected in the Editor.
Read time 3 minutesLast updated 13 days ago
When you profile the Unity Editor or Play mode, Unity groups their relevant timings into two sample groups that have the following markers:
- : Timings related to Play mode
PlayerLoop - : Timings related to the Editor
EditorLoop
Play mode samples
When you profile Play mode, the Profiler only collects timing samples that happened inside the . This group helps to reduce the amount of misleading measurements in the CPU and GPU Profiler modules.
PlayerLoopUnity categorizes any samples as Others in the CPU Profiler module charts, meaning that samples are the biggest contributors to the Others category. If you want to find out what the Editor does in this time and get a detailed breakdown of what contributes to the Others category, profile the Editor process.
EditorLoopEditorLoopEditor samples
When you profile the Editor process, all the samples that were previously hidden under the marker contribute to their respective categories. This means that the information in the CPU Profiler module’s detail pane and its charts changes significantly.
EditorLoopThere are certain profiler markers that only appear when you profile in the Unity Editor. These markers don't appear in Player-related activity, and only relate to Editor activity. Editor-only markers include:
- Security checks like the GetComponentNullErrorWrapper, which helps to identify a null component usage.
- CheckConsistency, which validates object setup.
- CheckAllowDestructionRecursive, which is a destruction check.
- Prefab-related activities.
By default, in the CPU Profiler module’s Hierarchy view, sample stacks with Editor-only markers are collapsed and are named . While these sample stacks or their child samples might cause managed allocations that can trigger garbage collection, they don't contribute to the value of their parent sample if they're collapsed.
EditorOnly [SampleName]GC.AllocTo change the default behavior, in the top right of the module details pane, select the context menu and disable the Collapse EditorOnly Samples setting. When you do this, you can expand the sample and contribute its value to the enclosing marker.
GC.AllocThis option doesn't affect the Timeline view, and the samples and their children appear expanded. You can usually ignore the samples with these markers, because they relate to Editor-only activity and don’t have any impact on reducing managed allocations. However, they can be useful to investigate if they have a significant performance impact on Play mode.