Microbenchmarking
rodri-oliveira-dev/Dapper-FluentMap
Activate when BenchmarkDotNet is involved or when a .NET performance question requires controlled microbenchmark measurement.
Activate this skill when BenchmarkDotNet (BDN) is involved in the task — creating, running, configuring, or reviewing BDN benchmarks.
$ npx skills add dotnet/skills --skill microbenchmarking -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install dotnet/skills microbenchmarking --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/dotnet/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/dotnet-diag/skills/microbenchmarking .claude/skills/microbenchmarking && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "microbenchmarking" agent skill from https://github.com/dotnet/skills/tree/main/plugins/dotnet-diag/skills/microbenchmarking into .claude/skills/microbenchmarking/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "microbenchmarking", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/dotnet/skills/tree/main/plugins/dotnet-diag/skills/microbenchmarkingType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add dotnet/skills --skill microbenchmarking -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install dotnet/skills microbenchmarking --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/dotnet/skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/plugins/dotnet-diag/skills/microbenchmarking .agents/skills/microbenchmarking && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "microbenchmarking" agent skill from https://github.com/dotnet/skills/tree/main/plugins/dotnet-diag/skills/microbenchmarking into .agents/skills/microbenchmarking/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "microbenchmarking", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add dotnet/skills --skill microbenchmarking -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install dotnet/skills microbenchmarking --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/dotnet/skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/plugins/dotnet-diag/skills/microbenchmarking .cursor/skills/microbenchmarking && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "microbenchmarking" agent skill from https://github.com/dotnet/skills/tree/main/plugins/dotnet-diag/skills/microbenchmarking into .cursor/skills/microbenchmarking/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "microbenchmarking", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/dotnet/skills.git --path plugins/dotnet-diag/skills/microbenchmarking--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add dotnet/skills --skill microbenchmarking -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install dotnet/skills microbenchmarking --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/dotnet/skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/plugins/dotnet-diag/skills/microbenchmarking .gemini/skills/microbenchmarking && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "microbenchmarking" agent skill from https://github.com/dotnet/skills/tree/main/plugins/dotnet-diag/skills/microbenchmarking into .gemini/skills/microbenchmarking/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "microbenchmarking", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install dotnet/skills microbenchmarkingInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add dotnet/skills --skill microbenchmarking -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/dotnet/skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/plugins/dotnet-diag/skills/microbenchmarking .github/skills/microbenchmarking && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "microbenchmarking" agent skill from https://github.com/dotnet/skills/tree/main/plugins/dotnet-diag/skills/microbenchmarking into .github/skills/microbenchmarking/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "microbenchmarking", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add dotnet/skills --skill microbenchmarking -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install dotnet/skills microbenchmarking --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/dotnet/skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/plugins/dotnet-diag/skills/microbenchmarking .opencode/skills/microbenchmarking && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "microbenchmarking" agent skill from https://github.com/dotnet/skills/tree/main/plugins/dotnet-diag/skills/microbenchmarking into .opencode/skills/microbenchmarking/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "microbenchmarking", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
microbenchmarkingActivate this skill when BenchmarkDotNet (BDN) is involved in the task — creating, running, configuring, or reviewing BDN benchmarks.
Microbenchmarking is an agent skill from dotnet/skills, published by the product's own GitHub organization. Activate this skill when BenchmarkDotNet (BDN) is involved in the task — creating, running, configuring, or reviewing BDN benchmarks. Also activate when microbenchmarking .NET code would be useful and BenchmarkDotNet is the likely tool. Consider activating when answering a .NET performance question requires measurement and BenchmarkDotNet may be needed. Covers microbenchmark design, BDN configuration and project setup, how to run BDN microbenchmarks efficiently and effectively, and using BDN for side-by-side…
Its SKILL.md is about 3.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including reference files (for example `references/bdn-internals-and-tuning.md`, `references/comparison-strategies.md` and `references/diagnosers-and-exporters.md`).
It sits in Testing & QA, covering Load testing. It works with .NET. The repository describes itself as: Repository for skills to assist AI coding agents with .NET and C. The licence is MIT.
3 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 8d670fa. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
dotnetFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Microbenchmarking loads about 3.3k tokens when it runs, and up to ~15k if it reads all its reference files. Until then it costs about 171 tokens; SKILL.md has 1,629 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from dotnet/skills at commit 8d670fa, republished under its MIT licence (© dotnet). 1,629 words, ~3,292 tokens.
.claude/skills/microbenchmarking/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.BenchmarkDotNet (BDN) is a .NET library for writing and running microbenchmarks. Throughout this skill, "BDN" refers to BenchmarkDotNet.
Note: Evaluations of LLMs writing BenchmarkDotNet benchmarks have revealed common failure patterns caused by outdated assumptions about BDN's behavior — particularly around runtime comparison, job configuration, and execution defaults that have changed in recent versions. The reference files in this skill contain verified, current information. You MUST read the reference files relevant to the task before writing any code — your training data likely contains outdated or incorrect BDN patterns.
OperationsPerInvoke=N, each invocation counts as N operations.A single benchmark number has limited value — it can confirm the order of magnitude of a measurement, but the exact value changes across machines, operating systems, and runtime configurations. Benchmarks produce the most useful information when compared against something. Before writing benchmarks, identify the comparison axis for the current task:
BDN can compare the first six axes side-by-side in a single run, but each requires specific CLI flags or configuration that differ from what you might expect — read references/comparison-strategies.md for the correct approach for each strategy before configuring a comparison.
There are four distinct reasons a developer writes a benchmark, and each one changes how the benchmark should be designed and where it should live:
Coverage suite: Write benchmarks to maximize coverage of real-world usage patterns so that regressions affecting most users are caught. These benchmarks are permanent — they belong in the project's benchmark suite, follow its conventions (directory structure, base classes, naming), and are checked in.
Issue investigation: Someone has reported a specific performance problem. Write benchmarks to reproduce and diagnose that specific issue. These benchmarks are task-scoped — they persist across the investigation (reproduce → isolate → verify fix) but are not part of the permanent suite.
Change validation: A developer has a PR or change and wants to understand its performance characteristics before merging. These benchmarks are task-scoped — they persist across the review cycle but are not checked in.
Development feedback: A developer is actively working on a task and wants to use benchmarks to evaluate approaches and get information early. These benchmarks are task-scoped and throwaway — they persist across the development session but are deleted when the decision is made.
For use case 1, add to the existing benchmark project following its conventions. For use cases 2–4, create a standalone project in a working directory that persists for the task but is clearly not part of the permanent codebase.
For coverage suite benchmarks, design from the perspective of real callers — what code patterns use this API, what inputs they pass, and what performance characteristics matter to them. Each permanent benchmark should justify its maintenance cost through real-world relevance. For temporary benchmarks, keep the case count intentional — each additional test case costs wall-clock time (read Cost awareness).
Each benchmark case (one method × one parameter combination × one job) takes 15–25 seconds with default settings. [Params] creates a Cartesian product: two [Params] with 3 and 4 values across 5 methods = 60 cases ≈ 20 minutes. Multiple jobs multiply this further. Before running, estimate the total case count and match the job preset to the situation:
| Preset | Per-case time | When to use |
|---|---|---|
--job Dry | <1s | Validate correctness — confirms compilation and execution without measurement |
--job Short | 5–8s | Quick measurements during development or investigation |
| (default) | 15–25s | Final measurements for a coverage suite |
--job Medium | 33–52s | Higher confidence when results matter |
--job Long | 3–12 min | High statistical confidence |
If benchmark runs take longer than expected, results seem unstable, or you need to tune iteration counts or execution settings, read references/bdn-internals-and-tuning.md for detailed information about BDN's execution pipeline and configuration options.
BDN programs use either BenchmarkSwitcher (provides interactive benchmark selection for humans, parses CLI arguments) or BenchmarkRunner (runs specified benchmarks directly). Both support CLI flags like --filter and --runtimes, but only when args is passed through — without it, CLI flags are silently ignored. When using BenchmarkSwitcher, always pass --filter to avoid hanging on an interactive prompt.
BDN behavior is customized through attributes, config objects, and CLI flags.
Read references/project-setup-and-running.md for entry point setup, config object patterns, and CLI flags. If you need to collect data beyond wall-clock time — such as memory allocations, hardware counters, or profiling traces — read references/diagnosers-and-exporters.md.
BenchmarkDotNet console output is extremely verbose — hundreds of lines per case showing internal calibration, warmup, and measurement details. Redirect all output to a file to avoid consuming context on verbose iteration output:
dotnet run -c Release -- --filter "*MethodName" --noOverwrite > benchmark.log 2>&1Each benchmark method can take several minutes. Rather than running all benchmarks at once, use --filter to run a subset at a time (e.g. one or two methods per invocation), read the results, then run the next subset. This keeps each invocation short — avoiding session or terminal timeouts — and lets you verify results incrementally. Read references/project-setup-and-running.md for filter syntax, CLI flags, and project setup.
After each run, read the Markdown report (*-report-github.md) from the results directory for the summary table. Only read benchmark.log if you need to investigate errors or unexpected results.
Before writing any code, determine:
Each benchmark case should justify its cost. An uncovered scenario is usually more valuable than another parameter combination for one already covered, but when a specific parameter dimension genuinely affects performance characteristics, the depth is warranted.
Decide on the list of test cases. For each test case, think through:
[Params] and [ParamsSource] for property-level parameters, [Arguments] and [ArgumentsSource] for method-level arguments, [ParamsAllValues] to enumerate all values of a bool or enum, and [GenericTypeArguments] for varying type parameters on generic benchmark classes. Choose the mechanism that best fits the dimension being varied. Read references/writing-benchmarks.md for the full set of options and correctness patterns.[Params] to avoid constant folding.[ParamsSource]/[ArgumentsSource]/[GlobalSetup] — when data shape matters more than specific content, or when input must be parameterized by size.For coverage suite benchmarks, add to the existing benchmark project and follow its conventions. For temporary benchmarks (investigation, change validation, development feedback), create a standalone project — read references/project-setup-and-running.md for project setup and entry point configuration.
Adding the BenchmarkDotNet package: Always use dotnet add package BenchmarkDotNet (no version) — this lets NuGet resolve the latest compatible version. Do NOT manually write a <PackageReference> with a version number into the .csproj; BDN versions in training data are outdated and may lack support for current .NET runtimes.
Write the benchmark code. Follow the patterns in references/writing-benchmarks.md to avoid common measurement errors — in particular:
[GlobalSetup] — setup inside the benchmark method is measured; use [IterationSetup] only when the benchmark mutates state that must be reset between iterations[Benchmark(Baseline = true)] for method-level comparisons or .AsBaseline() on a job for multi-job comparisons so results show relative ratios[Params], not as literals or const values — the JIT can fold constant expressions at compile time, making the benchmark measure a precomputed result instead of the actual computationValidate before committing to a long run:
--job Dry first to catch compilation errors and runtime exceptions without spending time on measurement.When iterating on benchmark design, use --job Short until confident, then switch to default for final numbers.
© dotnet, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 5 other files (references) in plugins/dotnet-diag/skills/microbenchmarking of dotnet/skills.
Open the folder on GitHubat commit 8d670fa
We found 4 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 3 other GitHub owners. This page covers the copy in dotnet/skills, which our catalogue first saw on October 7, 2026.
Microbenchmarking next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Microbenchmarking this skilldotnet/skills | 5.6k | 3 repos | ~3.3k | Automated safety check: Pass | MIT | |
| Microbenchmarkingrodri-oliveira-dev/Dapper-FluentMap | 453 | — | ~1.1k | Automated safety check: Pass | MIT | |
| Microbenchmarkingatherio-danp/cde-dotnetcc | 109 | — | ~979 | Automated safety check: Notes | None | |
| Code Reviewdotnet/macios | 2.9k | — | ~1.7k | Automated safety check: Pass | Custom licence | |
| Profilingmanagedcode/dotnet-skills | 486 | — | ~1.6k | Automated safety check: Pass | MIT | |
| Evaluate PR Testsdotnet/maui | 23k | — | ~2.9k | Automated safety check: Pass | MIT |
rodri-oliveira-dev/Dapper-FluentMap
Activate when BenchmarkDotNet is involved or when a .NET performance question requires controlled microbenchmark measurement.
atherio-danp/cde-dotnetcc
Create, run, configure, and interpret BenchmarkDotNet microbenchmarks in the .NET API — measure and compare approaches, runtime configs, or package versions.
dotnet/macios
Review dotnet/macios PRs against established rules. An agent skill from dotnet/macios.
managedcode/dotnet-skills
Use the free official .NET diagnostics CLI tools for profiling and runtime investigation in .NET repositories.
dotnet/maui
Reviews the tests added in a pull request for fix coverage, quality, edge cases and test type, and recommends lighter test types where they would do.
dotnet/macios
Investigate and triage CI failures for dotnet/macios from Azure DevOps build URLs.
dotnet/skills
Resolves .NET runtime frames in Apple .ips crash logs to function names, source files and line numbers using dSYM symbols, atos and the Microsoft symbol server.
dotnet/skills
Resolves native crash frames from .NET Android tombstones to function names, source files and line numbers using BuildIds, Microsoft's symbol server and llvm-symbolizer.
dotnet/skills
Scans C# and .NET code for about 50 performance anti-patterns and reports prioritized findings with concrete fixes, at a scan depth you choose.
dotnet/skills
Statically pairs source files with test files to list code that no test references, using Roslyn for C# or tree-sitter for many languages, with no build.
dotnet/skills
Makes .NET projects compatible with Native AOT and trimming by resolving IL trim and AOT analyzer warnings through annotations rather than suppressions.
dotnet/skills
Configures automatic crash dumps or captures dumps from running processes for modern .NET apps on Linux, macOS and Windows, including Docker and Kubernetes.
Works with
Categories
Activate this skill when BenchmarkDotNet (BDN) is involved in the task — creating, running, configuring, or reviewing BDN benchmarks. Microbenchmarking is an agent skill from dotnet/skills, published by the product's own GitHub organization. Activate this skill when BenchmarkDotNet (BDN) is involved in the task — creating, running, configuring, or reviewing BDN benchmarks.
Microbenchmarking fits situations like: profiling/tracing .NET code (dotnet-trace; production telemetry; load/stress testing (Crank.
Run `npx skills add dotnet/skills --skill microbenchmarking -a claude-code`. Or copy the skill folder (plugins/dotnet-diag/skills/microbenchmarking in dotnet/skills) into .claude/skills/microbenchmarking in your project. Claude Code loads it when a task matches its description.
Run `npx skills add dotnet/skills --skill microbenchmarking -a codex`. Or copy the skill folder (plugins/dotnet-diag/skills/microbenchmarking in dotnet/skills) into .agents/skills/microbenchmarking in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add dotnet/skills --skill microbenchmarking -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/microbenchmarking, .gemini/skills/microbenchmarking, .github/skills/microbenchmarking and .opencode/skills/microbenchmarking in your project.
Going by SKILL.md and its folder, Microbenchmarking needs the command-line tools its instructions call (dotnet).
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Microbenchmarking is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.3k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 12k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Microbenchmarking: Microbenchmarking (rodri-oliveira-dev/Dapper-FluentMap, 453 stars), Microbenchmarking (atherio-danp/cde-dotnetcc, 109 stars), Code Review (dotnet/macios, 2.9k stars) and Profiling (managedcode/dotnet-skills, 486 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
dotnet (a GitHub organization, an official publisher) maintains it in dotnet/skills, which has 5,568 GitHub stars. The repository holds 91 skills in this directory. The repository was last updated on October 7, 2026.
Source: dotnet/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.