dotnet-csharp-type-design-performance

Installation
SKILL.md

dotnet-csharp-type-design-performance

Upfront type design choices that affect performance throughout an application's lifetime. Covers the struct vs class decision matrix, sealed by default for library types, readonly struct for defensive copy elimination, ref struct and Span<T>/Memory<T> selection, and collection type selection including FrozenDictionary. This skill focuses on designing types correctly from the start, not on optimizing existing code.

Version assumptions: .NET 8.0+ baseline. FrozenDictionary (requires .NET 8+) is in-scope by default.

Scope

  • struct vs class decision matrix
  • sealed by default for library types
  • readonly struct for defensive copy elimination
  • ref struct and Span/Memory selection
  • Collection type selection (FrozenDictionary, ImmutableArray)

Out of scope

  • Runtime optimization techniques (pooling, caching, stackalloc) -- see [skill:dotnet-performance-patterns]
  • Language syntax for records and collection expressions -- see [skill:dotnet-csharp-modern-patterns]
  • GC behavior and memory management -- see [skill:dotnet-gc-memory]
Installs
4
GitHub Stars
218
First Seen
Feb 24, 2026
dotnet-csharp-type-design-performance — novotnyllc/dotnet-artisan