Visual Audit Protocol

Performance Tuning

Return to Hangar
202A

The Garbage Chute

The Concept: Garbage Collection (GC)

GC Spike
Zero Alloc
// Corrected: Event-Driven Update private int lastScore = -1; void Update() { // Only allocate memory when data changes if (currentScore != lastScore) { scoreText.text = $"Score: {currentScore}"; lastScore = currentScore; } }
202B

The Object Pool

The Concept: Object Pooling

POOL
20
Enable
Disable
Destroy
202C

The Component Cache

The Concept: Caching References

Update
Update
// Corrected: Zero-Lookup access private Renderer _rend; void Awake() { _rend = GetComponent<Renderer>(); // Walk to toolbox ONCE } void Update() { _rend.material.color = Color.red; // Instant access }
202D

The Math Weight

The Concept: LINQ vs. Loops

LINQ Alloc: High
OVERHEAD
FOR LOOP Alloc: Zero
202E

The Profiler Check

The Concept: Profiler.BeginSample

Function() { ... }
0.4ms
BeginSample
EndSample
202F

The Material Batch

The Concept: MaterialPropertyBlock

4 Draw Calls
1 Draw Call
CAPSTONE EXAM

The Tuning Exam

The aircraft is shuddering violently (Lag). The telemetry shows massive memory spikes and the engine is stalling (Frame Drops). Identify the **three critical performance failures** in this loop to stabilize the flight.

Verify Capacity
Check Scope
Audit Efficiency