analyzing-dotnet-performance

Scans C# code for performance anti-patterns and reports prioritized findings with fixes.

1|Updated Jun 1, 2026
One-click install
npx skills add https://github.com/D1ssolve/craft-agents --skill analyzing-dotnet-performance-d1ssolve
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: analyzing-dotnet-performance
Source: https://github.com/D1ssolve/craft-agents/tree/main/skills/analyzing-dotnet-performance
Command: npx skills add https://github.com/D1ssolve/craft-agents --skill analyzing-dotnet-performance-d1ssolve

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Manually auditing .NET code for performance issues is slow and error-prone. This Skill systematically scans C# code for roughly 50 known performance anti-patterns across async, memory, strings, collections, LINQ, regex, serialization, and I/O, then produces prioritized findings with concrete fixes. ## Core Features & Use Cases - Pattern Detection with Severity Tiers: Classifies findings as Critical (deadlocks, >10x regressions), Moderate (2-10x improvements), or Info, with scale-based escalation for codebase-wide issues. - Signal-Driven Scanning: Detects code signals (e.g., async, Span<, Regex, JsonSerializer) to select relevant detection recipes, with configurable scan depth (critical-only, standard, comprehensive). - Concrete Fix Guidance: Every finding includes exact file locations, instance counts, and a one-line fix description grounded in official .NET performance guidance. - Use Case: Before a release, point the Skill at your repository to audit hot paths for allocation-heavy patterns like missing StringComparison.Ordinal, uncached JsonSerializerOptions, or unsealed classes, and receive a compact, prioritized report. ## Quick Start Scan the C# files in my repository for performance anti-patterns and report the critical and moderate findings with fixes.

Frequently Asked Questions about analyzing-dotnet-performance

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

FAQPage Schema
How do I find performance anti-patterns in C# code?

Provide your C# files or repository paths and the Skill scans for roughly 50 known anti-patterns using grep-based detection recipes. Findings are grouped by severity with exact counts, file locations, and one-line fix descriptions.

What .NET performance issues does this analysis detect?

It detects sync-over-async deadlocks, missing StringComparison.Ordinal, Substring allocations, uncached JsonSerializerOptions, per-call HttpClient creation, LINQ on hot paths, non-source-generated regex, and unsealed classes, among others.

Does the .NET performance scan work on older framework versions?

Yes, but some patterns require specific versions, such as GeneratedRegex on .NET 7+, FrozenDictionary on .NET 8+, and params ReadOnlySpan on .NET 9+. Providing your target framework helps filter inapplicable recommendations.

When should I not use automated performance pattern scanning?

Avoid it for algorithmic complexity analysis, since it targets API usage patterns rather than algorithm design. Also skip code that is not on a hot path with no performance requirements to prevent premature optimization.

Why does the scan report zero hits for some patterns?

A zero-hit result is valid and valuable because it confirms good practice, such as all classes already being sealed. The verify-the-inverse rule counts both sides of absence patterns and reports the ratio.