dotnet-performance
Skill34 starsChanged 4 months agoMITView on GitHub
Evidence-first performance engineering workflow for coding agents combining portable .NET diagnostics with platform-native profiling, BenchmarkDotNet, application benchmarking, statistical validation, deployment, container, graphics, and GPU procedures.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- Xian55/WowClassicGrindBottheir own version, first seen Oct 8, 2026
- Attemainio/dotnet-toolkittheir own version, first seen Sep 19, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- Xian55/WowClassicGrindBot★ 349same name
- Attemainio/dotnet-toolkit★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 10 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this skill when investigating, explaining, fixing, benchmarking, or validating the performance of a .NET application, including ASP.NET …
- Distinctive: line 20
Do not infer managed retention from RSS alone.
- Distinctive: line 21
Do not infer GPU saturation from high frame time, GPU API usage, or utilization alone.
- Distinctive: line 22
Do not claim a fix from one average, one trace, one frame capture, one microbenchmark, or the fastest benchmark run.
- Distinctive: line 25
Treat command examples as version-sensitive.
- Distinctive: line 44
Never claim an improvement without before/after evidence from an equivalent workload.
- Very specific: line 48
Always begin with references/index.md, references/core/index.md, and the verified references/command-reference.md.
- Distinctive: line 62
Do not load every document by default.
- Very specific: line 71
If total cost is unexplained, collect the platform-native CPU/scheduler/I/O/memory trace.
- Very specific: line 98
Create artifacts/performance/<issue-or-timestamp>/ or the repository equivalent.
- Distinctive: line 99
Add a deterministic workload driver and stable markers when absent.
- Distinctive: line 103
Add a benchmark, regression budget, telemetry marker, trace recipe, or lifetime invariant that prevents recurrence.
- Distinctive: line 104
Keep large trace, capture, dump, and benchmark artifacts out of Git unless repository policy explicitly stores them.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
.NET Performance Engineering
Use this skill when investigating, explaining, fixing, benchmarking, or validating the performance of a .NET application, including ASP.NET Core, services, console applications, Avalonia, WPF, WinUI, MAUI, Skia, WebGPU, game/graphics engines, NativeAOT, and native-interoperability workloads.
This repository defines one skill. SKILL.md is the policy and routing entry point; detailed operational procedures live in a hierarchical reference tree. Load only the indexes and chapters required by the current investigation, then expand when evidence crosses an ownership boundary.
Non-negotiable rules
- Profile and benchmark an optimized build, normally
Release, in the real deployment form. - Record commit and dirty state, SDK/runtime, OS, architecture, hardware, power mode, workload, tool versions, environment overrides, and exact commands.
- Establish a deterministic reproduction before changing code.
- Separate cold startup, first use, warm steady state, overload, drain, and shutdown.
- Warm tiered compilation, shaders, pipelines, caches, and pools unless cold behavior is the subject.
- Collect evidence at every relevant ownership boundary: managed runtime, native library, kernel, scheduler, filesystem/network, dependency, driver, GPU, compositor, and display.
- Do not infer managed retention from RSS alone.
- Do not infer GPU saturation from high frame time, GPU API usage, or utilization alone.
- Do not claim a fix from one average, one trace, one frame capture, one microbenchmark, or the fastest benchmark run.
- Preserve raw artifacts and report missing symbols, dropped events, profiler overhead, environmental variance, and uncertainty.
- Protect secrets and personal data in dumps, traces, logs, SQL spans, packet captures, and benchmark input corpora.
- Treat command examples as version-sensitive. Query installed tool help first; it
overrides examples when syntax differs. Use
references/command-reference.mdfor verified selection rules and canonical forms.
Required investigation output
Report:
- Symptom — observable impact and violated target.
- Reproduction — deterministic workload and environment.
- Collection — exact tools, commands, duration, and artifact paths.
- Evidence — counters, traces, captures, dumps, benchmark distributions, and measurements.
- Ownership — managed CPU, runtime, native CPU, kernel, scheduler, I/O, dependency, memory, driver, GPU, compositor, or display.
- Dominant cause — largest supported cost, wait, or fastest-growing resource.
- Fix — smallest high-leverage code or configuration change.
- Validation — equivalent before/after runs with spread and tail metrics.
- Residual risks — unresolved bottlenecks and measurement limits.
Never claim an improvement without before/after evidence from an equivalent workload.
Reference router
Always begin with references/index.md, references/core/index.md, and the verified references/command-reference.md.
Load additional domain indexes by question:
- Managed CPU, allocation, GC, JIT, exceptions, ThreadPool, locks, async stacks, dumps:
references/runtime/index.md - Managed/native/VM/mapped/GPU memory ownership and leak analysis:
references/memory/index.md - Contention, async latency, queues, backpressure, file/network/database I/O, UI dispatcher latency:
references/latency/index.md - Cold start, first frame/request, loader, JIT, ReadyToRun, trimming, single-file, NativeAOT:
references/startup/index.md - BenchmarkDotNet, micro/component/macro/load/soak benchmarks, async/concurrency benchmarks, JIT/AOT comparisons, disassembly, hardware counters, statistics, CI gates:
references/benchmarking/index.md - Production, containers, diagnostic ports,
dotnet-monitor, triggered collection, Kubernetes, artifact security:references/production/index.md - UI/rendering/GPU/WebGPU/Metal/D3D/Vulkan/OpenGL/shader/synchronization/presentation:
references/gpu/index.md
Load every relevant platform reference through references/platforms/index.md. A single-host investigation usually needs one platform document; cross-platform comparisons and remote/client-server scenarios may require several.
Do not load every document by default. Select the minimum set that answers the current hypothesis, but do not stop at an ownership boundary merely because another guide is required.
Fast triage sequence
- Build and run the production-equivalent configuration.
- Define workload phases, success metrics, and a stopping rule.
- Record
System.Runtimecounters plus process CPU and total memory. - Capture managed CPU/runtime evidence with
dotnet-tracewhen managed ownership is plausible. - Capture repeated stacks when progress, starvation, or blocking is suspected.
- If total cost is unexplained, collect the platform-native CPU/scheduler/I/O/memory trace.
- For memory, compare managed live bytes, GC commitment, private/RSS/PSS, native allocations, mappings, graphics allocations, and GPU residency.
- For rendering, correlate application markers, CPU submission, GPU timestamps, native GPU capture, present, compositor, and display timing.
- For benchmark requests, choose micro, component, macro, load, or soak methodology before selecting BenchmarkDotNet or another harness.
- For production-only incidents, use bounded or triggered collection and record cgroup/host constraints.
- Implement only after evidence supports the dominant cause.
- Repeat the identical workload and publish median, spread, tail values, and raw artifacts.
Ownership tests
- High process CPU with hot managed stacks: application/JIT/runtime work.
- High process CPU below P/Invoke: native library, allocator, graphics API, or driver CPU.
- Low CPU with repeated blocked stacks: synchronization, I/O, scheduler, queueing, or external dependency.
- Rising ThreadPool queue with low CPU and blocking stacks: starvation or sync-over-async.
- Stable managed live bytes with growing private/RSS: native heap, mappings, code heaps, fragmentation, graphics resources, or OS caches.
- Growing live managed graph after equivalent full-collection points: managed retention or intentional unbounded cache.
- Long CPU frame with short GPU timestamps: application/render-thread/driver CPU bound.
- Short CPU submission with long GPU timestamps: GPU execution bound.
- CPU and GPU complete early but present is late: swapchain, compositor, vsync, drawable starvation, or display pacing.
- GPU idle gaps between dependent submissions: CPU starvation, excessive synchronization, serialization, or insufficient buffering.
- High latency with low on-CPU time: off-CPU wait, queueing, dependency, throttling, or scheduler delay.
- Startup improves but first action worsens: work was deferred rather than removed.
- Benchmark improves but the product metric does not: the experiment omitted the critical path, used the wrong input distribution, or optimized a non-dominant operation.
Agent operating procedure
- Inspect repository build, deployment, diagnostics, benchmark projects, input corpora, CI, and artifact conventions.
- Create
artifacts/performance/<issue-or-timestamp>/or the repository equivalent. - Add a deterministic workload driver and stable markers when absent.
- Store commands, environment metadata, analyzer/tool versions, and official reference links beside artifacts.
- Analyze inclusive costs first, then exclusive costs, callees, waits, queueing, synchronization, and ownership.
- Modify code only after the dominant cause is supported.
- Add a benchmark, regression budget, telemetry marker, trace recipe, or lifetime invariant that prevents recurrence.
- Keep large trace, capture, dump, and benchmark artifacts out of Git unless repository policy explicitly stores them.
- Validate failure, cancellation, overload, cleanup, device-loss, and shutdown paths—not only the happy path.
Invalid conclusions to reject
- “CPU is high, therefore method X is slow” without stacks.
- “RSS grew, therefore the managed heap leaks.”
- “The GC heap is stable, therefore there is no leak.”
- “Average latency/frame time is under budget, therefore tails are healthy.”
- “GPU utilization is high, therefore shader X is the bottleneck.”
- “The render thread is busy, therefore the GPU is busy.”
- “One frame capture represents steady-state behavior.”
- “Fewer draw calls always means faster rendering.”
- “More ThreadPool threads fix starvation.”
- “Async code cannot block.”
- “NativeAOT is automatically faster.”
- “A microbenchmark improvement proves application improvement.”
- “A statistically detectable delta is automatically product-significant.”
- “One benchmark run proves the result.”
Documentation footnotes
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

