dotnet-performance-patterns
Originally fromwshaddix/dotnet-skills
Installation
SKILL.md
dotnet-performance-patterns
Performance-oriented architecture patterns for .NET applications. Covers zero-allocation coding with Span<T> and Memory<T>, buffer pooling with ArrayPool<T>, struct design for performance (readonly struct, ref struct, in parameters), sealed class devirtualization by the JIT, stack-based allocation with stackalloc, and string handling performance. Focuses on the why (performance rationale and measurement) rather than the how (language syntax).
Version assumptions: .NET 8.0+ baseline. Span<T> and Memory<T> are available from .NET Core 2.1+ but this skill targets modern usage patterns on .NET 8+.
Scope
- Zero-allocation coding with Span and Memory
- Buffer pooling with ArrayPool
- Struct design for performance (readonly struct, ref struct, in parameters)
- Sealed class devirtualization by the JIT
- Stack-based allocation with stackalloc
- String handling performance patterns