unity-performance

Reviews Unity code for performance red flags like allocations, hot-path lookups, and pooling opportunities.

Updated Aug 31, 2026
One-click install
npx skills add https://github.com/pikachu0310/codex-agent-ops-public --skill unity-performance-pikachu0310
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-performance
Source: https://github.com/pikachu0310/codex-agent-ops-public/tree/main/.agents/skills/unity-skills/skills/performance
Command: npx skills add https://github.com/pikachu0310/codex-agent-ops-public --skill unity-performance-pikachu0310

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Unity projects often accumulate hidden performance problems—per-frame allocations, repeated GetComponent calls, excessive Update loops—that cause frame drops and GC spikes but are hard to spot during normal code review. This Skill provides a structured, high-signal checklist for diagnosing these issues before they reach production. ## Core Features & Use Cases - Red Flag Detection: Identifies common Unity performance anti-patterns including repeated Find/GetComponent calls in hot paths, frequent Instantiate/Destroy suitable for pooling, and per-frame allocations from LINQ, string formatting, closures, and boxing. - Hidden Cost Analysis: Explains counter-intuitive traps such as write-permission serialization costs, correlated random seeds, and Debug.Log executing in release builds. - Structured Review Output: Produces findings organized into confirmed red flags, likely red flags, changes worth doing now, and expected gain categories (clarity, frame time, GC, scalability). - Use Case: When a Unity game stutters during gameplay, run this review on the suspect scripts to pinpoint whether the cause is allocation churn, uncached component lookups, or physics updates at the wrong cadence. ## Quick Start Ask the assistant to review your Unity scripts for performance red flags and frame-drop causes using the unity-performance skill.

Frequently Asked Questions about unity-performance

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find performance problems in Unity code?

Review hot paths for repeated Find, GetComponent, Camera.main, and tag lookups, plus per-frame allocations from LINQ, string formatting, closures, and boxing. This Skill provides a structured checklist that categorizes findings into confirmed and likely red flags with expected gain estimates.

What causes frame drops and GC spikes in Unity games?

Common causes include frequent Instantiate/Destroy calls instead of pooling, avoidable per-frame allocations, too many unrelated Update loops, and reflection in runtime hot paths. Physics, animation, or UI updates running at the wrong cadence also contribute.

Does Debug.Log run in Unity release builds?

Yes, Debug.Log is not stripped in Player builds, so string interpolation and helper calls in log statements execute every frame in shipped games. Guard log expressions with Debug.isDebugBuild or use Conditional attributes to avoid the cost.

When should I use object pooling in Unity?

Use pooling when code frequently calls Instantiate and Destroy on the same object types, such as projectiles, enemies, or UI elements. The Skill flags frequent Instantiate/Destroy patterns as pooling candidates during review.

When should I avoid optimizing Unity code?

Avoid large refactors without a meaningful hotspot and do not replace simple readable code with obscure optimized versions unless the hot path is real. The Skill explicitly separates changes worth doing now from changes not worth doing.