| name | optimization-performance |
| version | 2.0.0 |
| description | Use when optimizing game performance, profiling frame rate, CPU/GPU bottlenecks, loading time, scalability, or multi-platform runtime behavior. |
| sasmp_version | 1.3.0 |
| bonded_agent | 02-game-programmer |
| bond_type | SECONDARY_BOND |
| parameters | [{"name":"bottleneck","type":"string","required":false,"validation":{"enum":["cpu","gpu","memory","loading","network"]}},{"name":"platform","type":"string","required":false,"validation":{"enum":["pc","console","mobile","vr","web"]}}] |
| retry_policy | {"enabled":true,"max_attempts":3,"backoff":"exponential"} |
| observability | {"log_events":["start","complete","error"],"metrics":["frame_time_ms","draw_calls","memory_mb","cpu_usage"]} |
Optimization & Performance
When to Use
Use this skill when:
- frame rate, profiling, bottlenecks, loading, scalability, or platform performance is in scope
- a task needs performance optimization strategy or verification guidance
Do not use this skill when:
- the task does not match the trigger conditions above
Performance Targets
FRAME BUDGETS:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ TARGET FPS โ FRAME TIME โ PLATFORM โ
โโโโโโโโโโโโโโโผโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ 30 FPS โ 33.3 ms โ Console (heavy games) โ
โ 60 FPS โ 16.6 ms โ PC, Console, Mobile โ
โ 90 FPS โ 11.1 ms โ VR (minimum) โ
โ 120 FPS โ 8.3 ms โ Competitive games โ
โ 144+ FPS โ 6.9 ms โ High-end PC โ
โโโโโโโโโโโโโโโดโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
FRAME TIME BREAKDOWN (16.6ms target):
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ CPU: 8ms โ
โ โโ Game Logic: 3ms โ
โ โโ Physics: 2ms โ
โ โโ Animation: 1.5ms โ
โ โโ Audio/Other: 1.5ms โ
โ โ
โ GPU: 8ms โ
โ โโ Geometry: 2ms โ
โ โโ Lighting: 3ms โ
โ โโ Post-process: 2ms โ
โ โโ UI: 1ms โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Profiling Process
OPTIMIZATION WORKFLOW:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 1. MEASURE: Profile before optimizing โ
โ โ Never guess, always profile โ
โ โ
โ 2. IDENTIFY: Find the bottleneck โ
โ โ CPU-bound: Frame time > GPU time โ
โ โ GPU-bound: GPU time > CPU time โ
โ โ
โ 3. ANALYZE: Drill into specific systems โ
โ โ Which function? Which shader? Which asset? โ
โ โ
โ 4. OPTIMIZE: Fix the actual bottleneck โ
โ โ One change at a time โ
โ โ Measure before/after โ
โ โ
โ 5. VERIFY: Confirm improvement โ
โ โ Check all platforms โ
โ โ Test edge cases โ
โ โ
โ 6. REPEAT: Move to next bottleneck โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
CPU Optimization
CPU OPTIMIZATION TECHNIQUES:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ALGORITHMIC: โ
โ โข Use appropriate data structures (spatial hashing) โ
โ โข Early-out conditions โ
โ โข Reduce O(nยฒ) to O(n log n) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ CACHE: โ
โ โข Data-oriented design (SoA vs AoS) โ
โ โข Minimize cache misses โ
โ โข Process data linearly โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ ALLOCATION: โ
โ โข Object pooling โ
โ โข Avoid GC in hot paths โ
โ โข Pre-allocate collections โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ THREADING: โ
โ โข Offload work to job system โ
โ โข Async loading โ
โ โข Parallel processing โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
GPU Optimization
GPU OPTIMIZATION TECHNIQUES:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ DRAW CALLS: โ
โ โข Static/dynamic batching โ
โ โข GPU instancing โ
โ โข Merge meshes โ
โ Target: <2000 on PC, <200 on mobile โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ OVERDRAW: โ
โ โข Front-to-back rendering โ
โ โข Occlusion culling โ
โ โข Reduce transparency โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ SHADERS: โ
โ โข Reduce instruction count โ
โ โข Use lower precision (half) โ
โ โข Minimize texture samples โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ GEOMETRY: โ
โ โข LOD systems โ
โ โข Mesh simplification โ
โ โข Frustum culling โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Platform-Specific Guidelines
MOBILE OPTIMIZATION:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ CRITICAL CONSTRAINTS: โ
โ โข Thermal throttling โ
โ โข Battery drain โ
โ โข Memory limits (500MB-2GB) โ
โ โ
โ TARGETS: โ
โ โข Draw calls: 100-200 โ
โ โข Triangles: 100K-500K/frame โ
โ โข Texture memory: 200-500MB โ
โ โข 30-60 FPS stable โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
VR OPTIMIZATION:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ CRITICAL: Maintain 90 FPS constantly โ
โ โข Single-pass stereo rendering โ
โ โข Fixed foveated rendering โ
โ โข Aggressive LOD โ
โ โข Minimal post-processing โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ง Troubleshooting
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PROBLEM: Frame rate drops during gameplay โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ DEBUG: โ
โ โ Profile to find CPU vs GPU bound โ
โ โ Check for GC spikes โ
โ โ Look for expensive operations in Update() โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ SOLUTIONS: โ
โ โ Move logic to FixedUpdate or coroutines โ
โ โ Implement object pooling โ
โ โ Add LOD for distant objects โ
โ โ Reduce draw calls with batching โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PROBLEM: Long loading times โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ SOLUTIONS: โ
โ โ Async loading with progress bar โ
โ โ Stream assets in background โ
โ โ Compress assets more aggressively โ
โ โ Pre-warm caches โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PROBLEM: Inconsistent frame pacing โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ SOLUTIONS: โ
โ โ Enable VSync โ
โ โ Use fixed timestep for physics โ
โ โ Spread heavy work across frames โ
โ โ Check for background processes โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Profiling Tools
| Engine | CPU Profiler | GPU Profiler | Memory |
|---|
| Unity | Profiler | Frame Debugger | Memory Profiler |
| Unreal | Insights | RenderDoc | Memreport |
| Godot | Profiler | GPU Debugger | Built-in |
| Any | Platform tools | RenderDoc/PIX | Valgrind/Instruments |
Use this skill: When optimizing games, profiling performance, or supporting multiple platforms.
Guardrails
- Prefer profiler or benchmark evidence over intuition.
- Do not optimize one metric while silently regressing correctness or player experience.