analyzing-dotnet-performance
하는 일
이 스킬은 .NET 코드에서 알려진 성능 문제를 검사하고 각 문제를 고치는 방법을 설명합니다. 출시 전에 느리거나 메모리를 많이 쓰는 코드를 찾으려는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓.NET 코드베이스나 자주 실행되는 코드 경로를 성능 문제로 검토받고 싶을 때.
- ✓메모리를 많이 할당하는 코드를 감사하고 싶을 때.
- ✓수동 성능 검토 뒤에 두 번째 의견이 필요할 때.
스킬 링크
https://github.com/dotnet/skills/blob/main/plugins/dotnet-diag/skills/analyzing-dotnet-performance/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 C# 서비스의 자주 실행되는 코드 경로에서 성능 문제를 검사하고, 영향이 큰 순서로 수정 방법을 정리해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트가 코드를 읽고, 알려진 성능 안티 패턴 목록과 비교하며, 우선순위를 매긴 발견 사항과 구체적인 수정 방법을 보고합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
.NET Performance Patterns
Scan C#/.NET code for performance anti-patterns and produce prioritized findings with concrete fixes. Patterns sourced from the official .NET performance blog series, distilled to customer-actionable guidance.
When to Use
- Reviewing C#/.NET code for performance optimization opportunities
- Auditing hot paths for allocation-heavy or inefficient patterns
- Systematic scan of a codebase for known anti-patterns before release
- Second-opinion analysis after manual performance review
When Not to Use
- Algorithmic complexity analysis — this skill targets API usage patterns, not algorithm design
- Code not on a hot path with no performance requirements — avoid premature optimization
Inputs
| Input | Required | Description |
|---|---|---|
| Source code | Yes | C# files, code blocks, or repository paths to scan |
| Hot-path context | Recommended | Which code paths are performance-critical |
| Target framework | Recommended | .NET version (some patterns require .NET 8+) |
| Scan depth | Optional | critical-only, standard (default), or comprehensive |
Workflow
Step 1: Load Critical Reference
Resolve bundled paths from the directory that contains this SKILL.md, not from the user's workspace. Load this reference file first:
references/critical-patterns.md
If a direct read fails, list this skill's references/ directory once and retry only when the listing shows the expected file. Do not use workspace file or text search to locate the skill installation.
Step 2: Detect Code Signals and Select Topic Recipes
Scan the code for signals that indicate which pattern categories to check. Use the ## Detection section from the critical reference when available and the inline recipes in Step 3 for initial signal detection.
After detecting signals, load only the topic-specific references selected by scan depth:
critical-only: No additional references (use onlycritical-patterns.md)standard(default): Load references matching detected signals from this list:references/async-patterns.md— async/Task/ValueTask signalsreferences/memory-and-strings.md— Span/Memory/string allocation signalsreferences/regex-patterns.md— Regex signalsreferences/collections-and-linq.md— Dictionary/List/LINQ signalsreferences/io-and-serialization.md— JsonSerializer/HttpClient/Stream signalsreferences/structural-patterns.md— always loaded (unsealed classes checked regardless)
comprehensive: Load all six topic-specific references above
For coverage reporting, the selected references are references/critical-patterns.md plus only the topic-specific references selected above. If any selected reference remains unavailable after retry, use the inline recipes in Step 3 for the missing coverage. Include Reference coverage: reduced; unavailable: <paths>; used inline recipes for missing references. in the final report, with <paths> replaced by the missing relative paths of the selected references only.
Use the ## Detection sections from loaded reference files and the inline recipes in Step 3 for categories whose reference files are unavailable.
| Signal in Code | Topic |
|---|---|
async, await, Task, ValueTask |
Async patterns |
Span<, Memory<, stackalloc, ArrayPool, string.Substring, .Replace(, .ToLower(), += in loops, params |
Memory & strings |
Regex, [GeneratedRegex], Regex.Match, RegexOptions.Compiled |
Regex patterns |
Dictionary<, List<, .ToList(), .Where(, .Select(, LINQ methods, static readonly Dictionary< |
Collections & LINQ |
JsonSerializer, HttpClient, Stream, FileStream |
I/O & serialization |
Always check structural patterns (unsealed classes) regardless of signals.
Scan depth controls scope:
critical-only: Only critical patterns (deadlocks, >10x regressions)standard(default): Critical + detected topic patternscomprehensive: All pattern categories
Step 3: Scan and Report
For files under 500 lines, read the entire file first — you'll spot most patterns faster than running individual grep recipes. Use grep to confirm counts and catch patterns you might miss visually.
For each relevant pattern category, run the detection recipes below. Report exact counts, not estimates.
Core scan recipes (run these when reference files aren't available):
# Strings & memory
grep -n '\.I
자주 묻는 질문
알고리즘도 검사하나요?
아니요. 알고리즘의 복잡도가 아니라 API가 사용되는 방식을 봅니다.
검사 깊이를 정할 수 있나요?
네. 검사를 치명적인 문제만, 표준, 또는 포괄적 검토 중에서 고를 수 있습니다.
자주 실행되는 코드 경로를 알아야 하나요?
알면 더 잘 동작합니다. 자주 실행되지 않는 코드는 변경이 필요하지 않을 수 있습니다.
상세 정보
작성자의 원본 설명
Scans .NET code for ~50 performance anti-patterns across async, memory, strings, collections, LINQ, regex, serialization, and I/O with tiered severity classification. Use when analyzing .NET code for optimization opportunities, reviewing hot paths, or auditing allocation-heavy patterns.
repo: dotnet/skills
인기도
- GitHub 스타
- 5.8k
- 순위
- #14573
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
create-custom-agent
5.8k에이전트가 자체 도구, 지침, 다른 에이전트로의 핸드오프를 가진 VS Code 커스텀 에이전트 파일을 만들도록 돕습니다.
create-skill
5.8k에이전트가 올바른 이름, 명확한 트리거 설명, 표준을 따르는 SKILL.md 파일로 새 에이전트 스킬을 만들도록 돕습니다.
csharp-scripts
5.8k에이전트가 .NET 명령줄 도구로 작은 C# 프로그램을 전체 프로젝트 없이 단일 파일로 실행하도록 돕습니다.
dotnet-pinvoke
5.8k에이전트가 .NET에서 네이티브 C나 C++ 라이브러리를 올바르게 호출하도록 돕습니다. 시그니처, 문자열 처리, 메모리, 안전 핸들을 다룹니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.