unity-performance

Unity Performance Optimization

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "unity-performance" with this command: npx skills add creator-hian/claude-code-plugins/creator-hian-claude-code-plugins-unity-performance

Unity Performance Optimization

Overview

Performance optimization for Unity games focusing on profiling and systematic optimization.

Foundation Required: unity-csharp-fundamentals (TryGetComponent, FindAnyObjectByType, null-safe coding)

Core Topics:

  • Unity Profiler analysis

  • Draw call reduction

  • GPU instancing and SRP Batcher

  • LOD (Level of Detail)

  • Occlusion culling

  • Object pooling

  • Memory optimization

Quick Start

Collection & Object Pooling

GC-free pooling is critical for performance. Use Unity's built-in UnityEngine.Pool namespace (2021.1+):

using UnityEngine.Pool;

// Temporary collection pooling - eliminates GC spikes List<Enemy> enemies; using (ListPool<Enemy>.Get(out enemies)) { GetComponentsInChildren(enemies); ProcessEnemies(enemies); } // Auto-released

See unity-collection-pool skill for comprehensive patterns:

  • ListPool, HashSetPool, DictionaryPool for temporary collections

  • ObjectPool for component/prefab pooling

  • Advanced patterns: Keyed pools, auto-return, ECS integration

Performance Targets

  • Mobile: 30-60 FPS, <100 draw calls

  • Desktop: 60+ FPS, <500 draw calls

  • VR: 90 FPS minimum, <200 draw calls

Profiling Workflow

  • Profile first: Identify actual bottleneck (CPU/GPU/Memory)

  • Measure baseline: Record before optimization

  • Optimize bottleneck: Focus on biggest impact

  • Measure improvement: Validate changes

  • Repeat: Until target performance reached

Optimization Checklist

CPU Optimization

  • ✅ Reduce Update/FixedUpdate calls

  • ✅ Object pooling for frequently spawned objects

  • ✅ Cache component references in Awake/Start

  • ✅ Use events instead of polling

GPU Optimization

  • ✅ Static batching for static objects

  • ✅ GPU instancing for identical meshes

  • ✅ Reduce SetPass calls via material sharing

  • ✅ LOD groups for distant objects

  • ✅ Occlusion culling for large scenes

Memory Optimization

  • ✅ Texture compression

  • ✅ Mesh optimization (reduce vertex count)

  • ✅ Audio compression and streaming

  • ✅ Asset bundle management

  • ✅ Unload unused assets

  • ✅ Collection pooling (see unity-collection-pool skill)

Reference Documentation

Profiling and Optimization Patterns

Detailed profiling workflows:

  • Unity Profiler module usage

  • Draw call reduction techniques

  • GPU instancing and SRP Batcher patterns

Related Skills

  • unity-collection-pool: GC-free collection management with ListPool, HashSetPool, DictionaryPool, and ObjectPool. Essential for eliminating GC spikes.

Best Practices

  • Profile on target platform: Editor performance differs

  • Optimize systematically: Measure, optimize, validate

  • Quality settings: Provide options for different hardware

  • Balance visuals vs performance: Adjust based on target

  • Test on low-end: Ensure minimum spec performance

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

unity-unitask

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

unity-networking

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

csharp-code-style

No summary provided by upstream source.

Repository SourceNeeds Review