dotnet_performance_games

Reduce .NET game code GC pressure and runtime overhead via zero-allocation patterns and profiling with BenchmarkDotNet or dotnet-trace.

2|Updated Jul 2, 2026
One-click install
npx skills add https://github.com/Xyrces/godot-ecs-gamedev-playbook --skill dotnet-performance-games
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet_performance_games
Source: https://github.com/Xyrces/godot-ecs-gamedev-playbook/tree/main/skills/dotnet_performance_games
Command: npx skills add https://github.com/Xyrces/godot-ecs-gamedev-playbook --skill dotnet-performance-games

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you eliminate frame-time spikes, GC churn, and cache-unfriendly code in performance-critical .NET game systems.

Core Features & Use Cases

  • Zero-allocation patterns for ECS updates, physics loops, and other hot paths.
  • Memory layout guidance for structs, components, pooling, and collection sizing.
  • Profiling workflows for BenchmarkDotNet and dotnet-trace, plus practical ref and Span usage.
  • Use it when reviewing movement, combat, pathfinding, or simulation code that must stay deterministic and fast.

Quick Start

Use this skill to review a game system for allocation hotspots and rewrite it with zero-allocation patterns, cache-friendly data layouts, and profiling-driven improvements.

Frequently Asked Questions about dotnet_performance_games

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

FAQPage Schema
How do I reduce GC pressure in .NET game code?

Reduce GC pressure in .NET game code by applying zero-allocation patterns, using struct pooling, and leveraging Span for memory-efficient batch processing in hot paths.

What's the best way to profile ECS systems for frame-time spikes?

Profile ECS systems for frame-time spikes using BenchmarkDotNet to measure execution overhead and dotnet-trace to capture detailed runtime allocation metrics.

How do I optimize cache-friendly struct layouts for physics updates?

Optimize cache-friendly struct layouts for physics updates by designing fixed-size components with sequential memory patterns, utilizing ref semantics to avoid copying.

Does BenchmarkDotNet work with fixed-timestep loops?

BenchmarkDotNet works with fixed-timestep loops by isolating and measuring specific logic branches, helping identify runtime overhead and maintain predictable frame times.

Why does my simulation code cause frame-time spikes during pathfinding?

Simulation code causes frame-time spikes during pathfinding due to GC churn from temporary collections and cache-unfriendly data access patterns in performance-critical paths.

Can I use Span to achieve zero-allocation in combat systems?

Use Span to achieve zero-allocation in combat systems by wrapping existing memory buffers for safe, contiguous access without generating garbage during batch processing.