Skip to content
cccskills
FreePublished on GitHub

dotnet-performance

Performance optimization and measurement for .NET applications. Navigation skill covering Span, ArrayPool, memory management, benchmarking, profiling, Native AOT, and optimization patterns. For building high-performance applications. Keywords: performance, optimization, span, arraypool, benchmarking, profiling, memory, gc, aot, native-aot

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md5.8 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

.NET Performance

Performance optimization and measurement for .NET applications. This meta-skill provides navigation to ~10 performance-focused skills covering zero-allocation coding, benchmarking, profiling, Native AOT, and optimization patterns.

When to Use This Skill

Load this skill when:

  • Optimizing application performance and allocations
  • Measuring performance with BenchmarkDotNet
  • Profiling memory or CPU usage
  • Building Native AOT applications
  • Tuning garbage collection
  • Reducing memory allocations

Quick Navigation

Optimization Patterns

NeedLoad SkillLevel
Span, ArrayPool, ref structdotnet-performance-patternsAdvanced
Type design for performancedotnet-csharp-type-design-performanceAdvanced
LINQ optimizationdotnet-linq-optimizationIntermediate

Memory Management

NeedLoad SkillLevel
GC tuning, LOH/POHdotnet-gc-memoryAdvanced
Struct vs class decisionsdotnet-csharp-type-design-performanceAdvanced

Measurement

NeedLoad SkillLevel
BenchmarkDotNet setupdotnet-benchmarkdotnetIntermediate
Profiling toolsdotnet-profilingAdvanced
CI performance gatesdotnet-ci-benchmarkingAdvanced

AOT & Compilation

NeedLoad SkillLevel
Native AOT publishingdotnet-native-aotAdvanced
AOT architecture patternsdotnet-aot-architectureAdvanced
WASM AOTdotnet-aot-wasmAdvanced
Trimmingdotnet-trimmingIntermediate
Multi-targetingdotnet-multi-targetingIntermediate

Platform-Specific

NeedLoad SkillLevel
MAUI iOS/Catalyst AOTdotnet-maui-aotAdvanced

Performance Decision Trees

Which Optimization Technique?

Reduce allocations → Span<T>, ArrayPool<T> (dotnet-performance-patterns)
        ↓
Improve throughput → Struct optimization (dotnet-csharp-type-design-performance)
        ↓
Reduce startup time → Native AOT (dotnet-native-aot)
        ↓
Optimize queries → LINQ optimization (dotnet-linq-optimization)

Which Measurement Tool?

GoalToolSkill
MicrobenchmarksBenchmarkDotNetdotnet-benchmarkdotnet
Live profilingdotnet-tracedotnet-profiling
Memory analysisdotnet-countersdotnet-profiling
Crash dumpsdotnet-dumpdotnet-profiling
CI gatingAutomated benchmarksdotnet-ci-benchmarking

When to Use Native AOT?

ScenarioRecommendation
CLI toolsStrongly recommended
MicroservicesConsider for fast startup
ContainersGood for size reduction
Web APIsEvaluate trade-offs
LibrariesUse IsTrimmable

Complete Skill List

Optimization Patterns (3 skills)

  • dotnet-performance-patterns - Span, ArrayPool, ref struct
  • dotnet-csharp-type-design-performance - Struct vs class design
  • dotnet-linq-optimization - IQueryable vs IEnumerable

Memory & GC (2 skills)

  • dotnet-gc-memory - GC tuning, LOH/POH
  • dotnet-performance-patterns - Memory patterns

Benchmarking & Profiling (3 skills)

  • dotnet-benchmarkdotnet - BenchmarkDotNet
  • dotnet-profiling - dotnet-counters, trace, dump
  • dotnet-ci-benchmarking - CI performance gating

AOT & Compilation (5 skills)

  • dotnet-native-aot - PublishAot, descriptors
  • dotnet-aot-architecture - AOT-first design
  • dotnet-aot-wasm - Blazor/Uno WASM
  • dotnet-trimming - Trimming annotations
  • dotnet-multi-targeting - Polyfills, multi-TFM

Platform-Specific (1 skill)

  • dotnet-maui-aot - MAUI iOS/Catalyst optimization

Build Optimization (2 skills)

  • dotnet-build-optimization - Slow build diagnosis
  • dotnet-artifacts-output - UseArtifactsOutput

Performance Patterns

Zero-Allocation Patterns

// Use Span<T> instead of arrays
public void Process(Span<byte> data) { }

// Use ArrayPool<T> for temporary buffers
var buffer = ArrayPool<byte>.Shared.Rent(1024);
try { /* use buffer */ }
finally { ArrayPool<byte>.Shared.Return(buffer); }

// Use stackalloc for small fixed buffers
Span<int> stack = stackalloc int[100];

Struct Design

// Mark readonly for immutability
public readonly struct Point(double x, double y);

// Use ref readonly for large structs
public ref readonly Point GetOrigin();

// Seal classes for devirtualization
public sealed class Calculator { }

GC Optimization

  • Use GC.TryStartNoGCRegion for critical sections
  • Pool objects to reduce Gen 0 collections
  • Avoid LOH fragmentation with ArrayPool
  • Consider GC configs for server apps

Cross-References

  • Fundamentals → dotnet-fundamentals
  • Architecture → dotnet-architecture
  • Security → dotnet-security
  • Web → dotnet-web

Version Assumptions

  • .NET 8.0+ for modern patterns
  • Native AOT requires .NET 7.0+
  • HybridCache requires .NET 8.0+
  • BenchmarkDotNet works on all versions

Anti-Patterns to Avoid

  1. Premature optimization - Measure first
  2. Ignoring GC pressure - Monitor allocations
  3. Using ValueTask incorrectly - Don't await twice
  4. Async void methods - Always use Task
  5. Ignoring async state machine overhead - Consider sync for hot paths

See Also

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Patterns and techniques for evaluating and improving AI agent outputs.

The English summary is being prepared. Showing the original description.

rudironsoni/Synaxis2Updated Mar 17, 2026

Comprehensive AI prompt engineering safety review and improvement prompt. Analyzes prompts for safety, bias, security vulnerabilities, and effectiveness while providing detailed improvement recommendations.

The English summary is being prepared. Showing the original description.

rudironsoni/Synaxis2Updated Mar 17, 2026

Use when user requests research requiring multiple sources, comprehensive analysis, or synthesis across topics - technical research, domain knowledge gathering, market analysis, or learning about complex subjects

The English summary is being prepared. Showing the original description.

rudironsoni/Synaxis2Updated Mar 17, 2026

AI-powered wiki generation for code repositories with commands, agents, and skills

The English summary is being prepared. Showing the original description.

rudironsoni/Synaxis2Updated Mar 17, 2026

Use when building .NET 10 or C# 14 applications; when using minimal APIs, modular monolith patterns, or feature folders; when implementing HTTP resilience, Options pattern, Channels, or validation; when seeing outdated patterns like old extension method syntax

The English summary is being prepared. Showing the original description.

rudironsoni/Synaxis2Updated Mar 17, 2026

Implements accessible .NET UI. SemanticProperties, ARIA, AutomationPeer, testing per platform.

The English summary is being prepared. Showing the original description.

rudironsoni/Synaxis2Updated Mar 17, 2026

See all skills by rudironsoni

Report a problem with this skill