unity-performance

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

Updated Aug 18, 2026
One-click install
npx skills add https://github.com/ethanJPope/Our-Main-Hackathon-Game --skill unity-performance-ethanjpope
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-performance
Source: https://github.com/ethanJPope/Our-Main-Hackathon-Game/tree/main/.agents/skills/unity-skills/skills/performance
Command: npx skills add https://github.com/ethanJPope/Our-Main-Hackathon-Game --skill unity-performance-ethanjpope

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 code review. This Skill provides a structured, high-signal checklist for diagnosing these issues without speculative micro-optimizations. ## 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 avoidable per-frame allocations from LINQ, closures, boxing, and string formatting. - Hidden Cost Analysis: Explains counter-intuitive traps where cost is paid for the possibility of work—write-permission serialization overhead, correlated random seeds, and Debug.Log executing in release builds. - Prioritized Output: Delivers findings organized as 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, use this Skill to review MonoBehaviour scripts and get a prioritized list of allocation and hot-path fixes before touching the profiler. ## Quick Start Ask the assistant to review my Unity scripts for performance red flags and suggest which optimizations are worth doing now.

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 C# scripts?

Review scripts for common red flags: repeated GetComponent, Find, or Camera.main calls in Update loops, per-frame allocations from LINQ or string formatting, and frequent Instantiate/Destroy that should use object pooling. This Skill provides a structured checklist for exactly these patterns.

What causes GC spikes in Unity games?

GC spikes come from per-frame heap allocations, typically LINQ queries, string interpolation, closures capturing variables, and boxing of value types. Reducing these allocations in hot paths like Update and FixedUpdate eliminates most spike sources.

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 logging with Debug.isDebugBuild or use methods marked with Conditional attributes.

When should I use object pooling in Unity?

Use pooling when objects are frequently instantiated and destroyed during gameplay, such as projectiles, enemies, or effects. Pooling avoids the allocation and destruction overhead of Instantiate/Destroy in hot paths, but is unnecessary for one-time scene setup.

Why is seeding random generators with baseSeed plus index a problem?

Seeding N RNG instances with sequential values like baseSeed + i produces correlated random streams, causing patrol paths to line up and spawn jitter to clump. Hash the index before seeding, or use Unity.Mathematics Random.CreateFromIndex which handles this internally.