Optimizes hot-path scalar loops in .NET 8+ with cross-platform Vector128/Vector256/Vector512 SIMD intrinsics, or replaces manual math loops with single TensorPrimitives API calls.
.NET Profiling
Use the free official .NET diagnostics CLI tools for profiling and runtime investigation in .NET repositories. Use when a repo needs CPU tracing, live counters, GC and allocation investigation, exception or contention tracing, heap snapshots, or startup diagnostics without GUI-only tooling.
Trigger On
- the repo needs performance or runtime profiling for a .NET application
- the user asks about slow code, high CPU, GC pressure, allocation growth, exception storms, lock contention, or startup diagnostics
- the team wants official CLI-based diagnostics without depending on
dnx
Workflow
- Build and run a realistic target first:
- prefer Release - prefer realistic config, inputs, and data volume
- Start with the lightest useful tool:
- dotnet-counters for live health signals - dotnet-trace for CPU, exception, contention, GC, and startup traces - dotnet-gcdump for managed heap inspection when memory shape matters
- Prefer installed CLI tools over
dnxone-shot execution so the repo commands stay stable and reproducible. - Capture one focused profile at a time instead of mixing every signal into one run.
- For CPU and general runtime hotspots, start with
dotnet-trace collect. - For live triage, start with
dotnet-counters monitoronSystem.Runtime. - For heap analysis, use
dotnet-gcdumpcarefully and document the pause risk. - After each change, rerun the same measurement path and compare before versus after.
Deliver
- explicit official .NET profiling commands
- a clear profiling path for CPU, counters, and heap inspection
- reproducible diagnostics commands that humans and agents can rerun
Validate
- the chosen tool matches the actual symptom
- commands target a realistic process and configuration
- before/after comparisons use the same scenario
- heap collection warnings are explicit when
dotnet-gcdumpis used
Load References
references/commands.mdreferences/patterns.mdreferences/profiling.md
Related skills
Use the open-source free `Asynkron.Profiler` dotnet tool for CLI-first CPU, allocation, exception, contention, and heap profiling of .NET commands or existing trace artifacts.
Use the open-source CodeQL ecosystem for .NET security analysis.
Related agents
.NET Build
Build-focused orchestration agent for .NET restore, build, test, packaging, CI failures, diagnostics, and environment drift.
Also works: dotnet agents install build