スキル一覧に戻る
Sharks820

unity-performance-check

by Sharks820

0🍴 0📅 2026年1月25日
GitHubで見るManusで実行

SKILL.md


name: unity-performance-check description: Use before committing code or after major changes to verify performance. Catches expensive operations before they cause frame drops.

Unity Performance Check

Overview

Verify code performance BEFORE it causes problems in production. Frame drops ruin games.

When to Use

  • Before committing new code
  • After implementing Update/FixedUpdate logic
  • When adding new systems
  • Before major milestones
  • When users report lag

The Quick Check (30 seconds)

Run these searches on changed files:

// RED FLAGS - Fix these immediately:
GetComponent         // In Update? Cache it
Find(                // In Update? Never do this
FindObjectOfType     // Anywhere? Avoid if possible
new List             // In Update? Preallocate
new Dictionary       // In Update? Preallocate
.ToString()          // In Update? Cache or avoid
string +             // In Update? StringBuilder
foreach              // On non-List? May allocate

The Full Check (5 minutes)

Use the unity-performance-profiler agent:

Task: Launch unity-performance-profiler agent with:
"Analyze [file/folder] for performance issues"

Performance Rules

Update Loop (60fps = 16.6ms budget)

OperationCostRule
GetComponent~1msCache in Start
Find/FindObjectOfType~5-50msNever use
Instantiate~2-10msUse object pool
new List/Dictionary~0.1ms + GCPreallocate
String concat~0.5ms + GCStringBuilder
LINQ query~1-5ms + GCUse loops
Physics.Raycast~0.1msBatch or limit

Memory (GC spikes cause stutters)

CauseSolution
new in UpdatePreallocate collections
String operationsCache strings, use StringBuilder
LINQ methodsConvert to explicit loops
Boxing (int to object)Use generics
Closures in lambdasCache delegates
foreach on IEnumerableUse for loops on arrays/lists

VeilBreakers-Specific

SystemPerformance ConcernSolution
CombatDamage calc per frameBatch damage events
Brand lookupSwitch statementDictionary lookup
Synergy calcRecalc every frameCache on party change
UI updatesRebuild every frameDirty flag pattern

Checklist

Before committing, verify:

  • No GetComponent in Update/FixedUpdate
  • No Find/FindObjectOfType anywhere
  • No allocations in hot paths
  • Collections preallocated
  • Strings not concatenated in loops
  • Events properly unsubscribed
  • Object pooling for spawned objects

If Performance is Bad

  1. Profile first - Don't guess, measure
  2. Find the hotspot - Usually 1-2 methods
  3. Fix the algorithm - O(n²) → O(n) > micro-optimizations
  4. Cache results - Don't recalculate what hasn't changed
  5. Batch operations - Process multiple items together
  6. Use jobs/burst - For heavy math (advanced)

スコア

総合スコア

40/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です