Analyze Entity Component System implementations for performance bottlenecks including entity iteration efficiency, system priority ordering, memory allocation patterns in hot paths (OnUpdate, rendering loops), cache coherency, LINQ allocations, and boxing issues. Use when reviewing ECS code for optimization, debugging slow entity updates, or investigating frame rate drops.
This skill performs comprehensive performance analysis of Entity Component System implementations in the C#/.NET 10.0 game engine. It identifies bottlenecks, memory allocation issues, and cache coherency problems that impact frame time.
Invoke this skill when encountering:
GetEntitiesWith<T>() calls in hot pathsSceneSystemRegistry and SystemManagerSystemPriorities.cs):
OnUpdate(), Render(), OnEvent() loops.ToList(), .ToArray())Span<T> and stackalloc and Memory<T> where appropriateScriptableEntity)dotnet-trace or profiler commandsBenchmark project and docs/specifications/physics-benchmark-design.mdProvide findings in this structure:
Issue: [Clear description of the problem]
Impact: [Performance cost - frame budget impact, allocation rate, cache misses]
Location: [File path with line numbers, e.g., Engine/Scene/Systems/MySystem.cs:42]
Recommendation: [Specific optimization with code example]
Priority: [Critical/High/Medium/Low based on frame time impact]
**Issue**: LINQ materialization in OnUpdate() loop
**Impact**: ~5,000 allocations per frame (60fps = 300k/sec), causing GC pressure
**Location**: Engine/Scene/Systems/RenderingSystem.cs:156
**Recommendation**: Replace `.ToList()` with direct iteration:
// Before
foreach (var entity in scene.GetEntitiesWith<SpriteRendererComponent>().ToList())
// After
foreach (var entity in scene.GetEntitiesWith<SpriteRendererComponent>())
**Priority**: High
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer