UNITY PROFILER GUIDE FOR BEGINNERS: FINDING BOTTLENECKS

Learn how to connect the Unity Profiler to physical devices via ADB, diagnose CPU vs GPU bound limits, eliminate GC allocations, and fix frame rate hitching.

1. Connecting the Profiler to an Android Device

Never profile inside the Unity Editor alone: the Editor overhead, scene view rendering, and debug symbols produce inaccurate timings. Always profile on a physical target device:

  1. In Unity, go to File > Build Settings.
  2. Check Development Build and Autoconnect Profiler.
  3. Connect your Android phone via USB and ensure USB Debugging is enabled in Developer Options.
  4. Click Build And Run.
  5. Open the Profiler window in Unity (Ctrl + 7 or Cmd + 7). Unity will automatically stream real-time telemetry from your device over ADB.

2. Is Your Game CPU-Bound or GPU-Bound?

CPU-Bound Symptoms
Main Thread Time exceeds 16.6ms.
Profiler Markers: High Update() times, Physics.Simulate spikes, heavy GC.Alloc garbage pauses, or excessive draw call driver overhead.
GPU-Bound Symptoms
Gfx.WaitForPresentOnGfxThread dominates the CPU timeline (the CPU is waiting for the slow GPU to finish rendering).
Causes: High screen resolution overdraw, heavy fragment/pixel shaders, uncompressed textures, or excessive real-time shadows.

3. Hunting Garbage Allocations (GC.Alloc)

In the CPU Usage module, switch the display from Timeline to Hierarchy and click the GC Alloc column header to sort by memory consumption.

Any script allocating even 20 to 50 bytes per frame inside Update() is a primary candidate for optimization (e.g. converting string concatenations to cached strings, replacing LINQ with for-loops, or pooling GameObjects).

Related Mobile Optimization Guides & Tools

Frequently Asked Questions

Open Window > Analysis > Frame Debugger. It freezes playback and lets you step through every individual draw call in sequence to see exactly how your scene is rendered, which objects broke SRP batching, and where transparent overdraw is occurring.
WaitForTargetFPS indicates that your CPU finished all its work ahead of the targeted frame time (e.g. 16.6ms for 60 FPS) and is simply sleeping until the next VSync interval. This is a healthy sign that your game is running smoothly with CPU headroom to spare.