Performance Rules
These rules focus specifically on C# patterns inside Unity that destroy CPU frametimes.
Code Hygienist detects these runtime allocations and intercepts them.
Included Rules
Core Logic
GetComponentInUpdateRule: Detects and cachesGetComponent<T>()out ofUpdate.CameraMainInUpdateRule: Scans for.mainstring evaluation properties in loops.HeavyFindsRule: StripsFindObjectOfType,GameObject.Find, and tag searches out of looping behaviors.
Memory & Allocations
BoxingDetectionRule: Detects boxing allocations (e.g., passing value types toobjectparameters).StringAllocationInUpdateRule: Flags string concatenations and allocations inside per-frame loops.LinqInUpdateRule: Detects LINQ usage (.Where,.First, etc.) insideUpdate, which causes hidden per-frame allocations.
Unity Specifics
CompareTagRule: Replaces.tag == "string"with the allocation-free.CompareTag("string").EmptyUnityEventsRule: Detects empty Unity Events (likeUpdate,Start) that still incur a native-to-managed call overhead.PhysicsNonAllocRule: Encourages the use ofNonAllocphysics variants (e.g.,OverlapSphereNonAlloc) to avoid array allocations.
Look at the child pages for deep dives into how the Auto-Fix engine translates these rules safely.