analyzing-dotnet-performance
यह क्या करती है
यह स्किल .NET code को ज्ञात प्रदर्शन समस्याओं के लिए जाँचती है और हर एक को ठीक करने का तरीका समझाती है। यह उन डेवलपर के लिए है जो release से पहले धीमा या memory-भारी code पकड़ना चाहते हैं।
कब इस्तेमाल करें
- ✓जब आप .NET codebase या hot code path की प्रदर्शन समस्याओं के लिए समीक्षा चाहें।
- ✓जब आप ऐसे code का ऑडिट चाहें जो बहुत memory allocate करता है।
- ✓जब मैनुअल प्रदर्शन समीक्षा के बाद आपको दूसरी राय चाहिए।
Skill का लिंक
https://github.com/dotnet/skills/blob/main/plugins/dotnet-diag/skills/analyzing-dotnet-performance/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“इस C# सेवा के hot paths में प्रदर्शन समस्याएँ जाँचिए और सुधारों को असर के हिसाब से रैंक कीजिए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट code पढ़ता है, उसे प्रदर्शन anti-patterns की सूची से मिलाता है, और ठोस सुधारों के साथ प्राथमिकता वाले निष्कर्ष देता है।
तकनीकी सामग्री (मूल 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
अक्सर पूछे जाने वाले सवाल
क्या यह algorithms जाँचती है?
नहीं। यह देखती है कि APIs कैसे इस्तेमाल होते हैं, algorithm की जटिलता नहीं।
क्या मैं scan की गहराई तय कर सकता हूँ?
हाँ। scan को सिर्फ़ गंभीर समस्याओं, मानक या पूरी समीक्षा तक सीमित किया जा सकता है।
क्या इसे hot paths पता होने चाहिए?
इनके साथ यह बेहतर काम करती है, क्योंकि hot path पर न होने वाले code में बदलाव ज़रूरी नहीं हो सकता।
जानकारी
लेखक का मूल विवरण
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
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
create-custom-agent
5.8kयह आपके एजेंट को VS Code के custom agent फ़ाइलें बनाने देती है, जिनके अपने tools, निर्देश और दूसरे agents को handoffs होते हैं।
create-skill
5.8kयह आपके एजेंट को सही नाम, साफ़ trigger विवरण और मानक के अनुसार SKILL.md फ़ाइल वाली नई agent skill बनाने में मदद करती है।
csharp-scripts
5.8kयह आपके एजेंट को .NET command line टूल से एक छोटा C# प्रोग्राम एकल फ़ाइल के रूप में चलाने देती है, पूरा प्रोजेक्ट बनाए बिना।
dotnet-pinvoke
5.8kयह आपके एजेंट को .NET से native C या C++ libraries सही तरीके से कॉल करने में मदद करती है, जिसमें signatures, string संभालना, memory और सुरक्षित handles शामिल हैं।
मिलती-जुलती skills
api-connector-builder
280kयह आपके एजेंट को मौजूदा pattern के हिसाब से नए API connections बनाने देता है। जब बिना कोई नया तरीका बनाए एक और integration जोड़ना हो, तब इसका इस्तेमाल करें।
api-design
280kयह आपके एजेंट को best practices के हिसाब से REST APIs डिज़ाइन करने में मदद करता है। यह तय करने में काम आता है कि APIs आपस में कैसे बात करें, errors कैसे दिखें, और data को कैसे व्यवस्थित करें।
backend-patterns
280kआपके एजेंट को server-side architecture patterns और database optimization में मदद करता है। server पर चलने वाला code बनाने या review करने के लिए उपयोगी है।