performance
Investigate .NET runtime performance using logs, metrics, traces, spans and profiles; collect crash/hang diagnostics. Use for CPU, GC, allocation or latency problems, hot-path reviews and BenchmarkDotNet comparisons. MSBuild timing belongs to msbuild; MSTest execution belongs to mstest-extensions.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-10
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- performance
- license
- Apache-2.0
- description
- Investigate .NET runtime performance using logs, metrics, traces, spans and profiles; collect crash/hang diagnostics. Use for CPU, GC, allocation or latency problems, hot-path reviews and BenchmarkDotNet comparisons. MSBuild timing belongs to msbuild; MSTest execution belongs to mstest-extensions.
02 资源文件 4
- 参考文档agents/openai.yaml288 B
- 参考文档references/benchmarks.md2.0 KB
- 参考文档references/diagnostics.md3.9 KB
- 参考文档references/hot-paths.md1.6 KB
03 SKILL.md 正文
.NET runtime performance
Process
- Name the question. Establish the workload, symptom, runtime, OS and comparison: implementations, revisions, runtimes or input sizes. Keep source-review hypotheses separate from measured costs. A command-only request needs commands, not an unrequested collection session.
- Choose the evidence. Load only the matching reference below. Reuse the repository's telemetry, tools and package policy. Correlate deployed revision, workload, time window and trace/span identifiers before collecting more data. Bound collection duration and benchmark case count to the question; keep investigative artifacts outside tracked source.
- Compare like with like. Hold workload and environment constant. Check result equivalence before interpreting speedups. Report the measured scope, uncertainty and artifact paths; an inconclusive result is not an optimization claim.
| Question | Reference |
|---|---|
| Which implementation, runtime or revision is faster? | Benchmarks |
| Which production operation is slow, and where does its time go? | Diagnostics: logs, metrics, traces/spans, then targeted profiles |
| Where does CPU, memory or waiting go; how do I capture a crash/hang? | Diagnostics |
| Which source patterns warrant a measured change? | Hot paths |
Bounded collection example
When existing evidence leaves a trace-shaped gap, confirm the CoreCLR process, tool support and writable output location before this 20-second capture:
dotnet-trace collect --process-id PID --duration 00:00:00:20 --output /tmp/runtime.nettrace
Choose a fresh artifact path outside tracked source; a capture alone is not a root-cause finding. The diagnostics reference covers events and interpretation.
For build-time work, invoke ancplua-dotnet:msbuild; native MSTest verification
uses mstest-extensions:mstest. Check availability before the handoff and report
a missing specialist. This skill retains ownership of runtime measurement.
04 同仓库更多 Skills
csharp-union-types
Design, review and implement C# 15 unions and closed hierarchies in .NET 11 code. Use for union declarations, custom [Union] types, exhaustive matching, default/null handling and union serialization. Do not upgrade earlier frameworks or replace working inheritance merely because unions exist.
release
Releases .NET NuGet packages through a layered chain (library, MSBuild SDK, analyzers, consumers) without breaking restore. Use when publishing a package, bumping a lower-layer dependency in its consumers, moving a .NET SDK pin across repositories, choosing tag-driven versus push-driven publishing, setting up NuGet trusted publishing, or waiting for nuget.org to index a version before consumers restore it.
nuget-versions
Manage .NET package and SDK versions, CPM migrations, Version.props ownership, global.json pins, isolated SDK installations and Renovate updates. Use for package bumps, conflicting or missing versions, NuGet restore errors and SDK selection. MSTest runner/profile semantics belong to mstest-extensions.
msbuild
Writes and reviews MSBuild evaluation, properties, items, imports, custom targets and build/buildTransitive package assets for SDK-style .NET repositories. Use for ignored or empty properties/items, generated files, analyzer/build-asset packaging, build-file reviews, binlog diagnosis and incremental-build problems. Focused MSTest project setup, runner configuration and test commands belong to mstest-extensions.
csharp-refactoring
Refactor C# and reconcile stale constants, dead checks and abandoned code, including indirect production uses. Use for renames, moves, deduplication, exhaustive cleanup, generated declarations and runtime/API contracts. MSTest test design and review belong to mstest-extensions.
audit
Audits one or more .NET repositories for build, package and analyzer problems and separates certain fixes from judgment calls. Use for repository or fleet build-policy audits, shared SDK/package consistency and cross-repository version rollouts. Focused MSTest setup, execution and test-quality reviews belong to mstest-extensions.