Skip to content

t1k:unity:editor:profiling

FieldValue
Moduleeditor
Version2.1.7
Effortmedium
Tools

Keywords: optimization, performance, profiling, unity profiler

/t1k:unity:editor:profiling

Unity Profiling — Performance Analysis Tools

Section titled “Unity Profiling — Performance Analysis Tools”

Profiling reference for Unity 6. For DOTS-specific profiling, see dots-performance.

Window → Analysis → Profiler (Ctrl+7)

ModuleKey Metrics
CPU UsageMain Thread ms, GC Alloc
GPU UsageDraw calls, GPU ms
RenderingSetPass calls, batches
MemoryTotal allocated, GC
PhysicsActive bodies, contacts
AudioPlaying sources, CPU %

Custom Markers (ProfilerMarker) — Quick Reference

Section titled “Custom Markers (ProfilerMarker) — Quick Reference”
using Unity.Profiling;
static readonly ProfilerMarker s_UpdateMarker = new("GameSystem.Update");
void Update() {
using (s_UpdateMarker.Auto()) { DoGameLogic(); } // Auto-dispose scope
}

→ See references/profiling-api.md for full ProfilerMarker, ProfilerRecorder, custom counters.

  • Memory Profiler: Install com.unity.memoryprofiler → compare snapshots to find leaks
  • Frame Debugger: Window → Analysis → Frame Debugger → inspect every draw call
  • Device Profiling: Build with Development Build + Autoconnect Profiler; connect USB or WiFi

→ See references/profiling-api.md for device setup, automated logging, and deep profiling details.

SymptomLikely CauseFix
CPU spike every few framesGC collectionPool objects, use structs
High “Scripts” timeExpensive Update()Cache components
High “Rendering” timeToo many draw callsBatch, atlas textures
GPU bound (CPU idle)Complex shadersSimplify, reduce transparency
Memory grows over timeLeakMemory Profiler snapshots

→ Full bottleneck table and gotchas in references/profiling-api.md.

  1. Editor vs Build: Editor is 2–10x slower — always profile builds
  2. GC.Alloc column: Any allocation in Update/FixedUpdate is a red flag
  3. Burst code: Shows as single block — use ProfilerMarker inside Burst jobs
  • dots-performance — DOTS profiling (use dots-optimizer agent)
  • unity-mobile — Device profiling patterns
  • unity-urp — SRP Batch Debugger
  • dots-debugger — ECS runtime debug (use dots-debugger agent)
FileContents
references/profiling-api.mdFull API, all tools, bottleneck table, gotchas