t1k:unity:editor:profiling
| Field | Value |
|---|---|
| Module | editor |
| Version | 2.1.7 |
| Effort | medium |
| Tools | — |
Keywords: optimization, performance, profiling, unity profiler
How to invoke
Section titled “How to invoke”/t1k:unity:editor:profilingUnity Profiling — Performance Analysis Tools
Section titled “Unity Profiling — Performance Analysis Tools”Profiling reference for Unity 6. For DOTS-specific profiling, see dots-performance.
Profiler Window
Section titled “Profiler Window”Window → Analysis → Profiler (Ctrl+7)
| Module | Key Metrics |
|---|---|
| CPU Usage | Main Thread ms, GC Alloc |
| GPU Usage | Draw calls, GPU ms |
| Rendering | SetPass calls, batches |
| Memory | Total allocated, GC |
| Physics | Active bodies, contacts |
| Audio | Playing 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.
Key Tools
Section titled “Key Tools”- 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.
Common Bottlenecks
Section titled “Common Bottlenecks”| Symptom | Likely Cause | Fix |
|---|---|---|
| CPU spike every few frames | GC collection | Pool objects, use structs |
| High “Scripts” time | Expensive Update() | Cache components |
| High “Rendering” time | Too many draw calls | Batch, atlas textures |
| GPU bound (CPU idle) | Complex shaders | Simplify, reduce transparency |
| Memory grows over time | Leak | Memory Profiler snapshots |
→ Full bottleneck table and gotchas in references/profiling-api.md.
Common Gotchas
Section titled “Common Gotchas”- Editor vs Build: Editor is 2–10x slower — always profile builds
- GC.Alloc column: Any allocation in Update/FixedUpdate is a red flag
- Burst code: Shows as single block — use
ProfilerMarkerinside Burst jobs
Related Skills & Agents
Section titled “Related Skills & Agents”dots-performance— DOTS profiling (usedots-optimizeragent)unity-mobile— Device profiling patternsunity-urp— SRP Batch Debuggerdots-debugger— ECS runtime debug (usedots-debuggeragent)
Reference Files
Section titled “Reference Files”| File | Contents |
|---|---|
references/profiling-api.md | Full API, all tools, bottleneck table, gotchas |