microbenchmarking

仓库创建 2026年2月4日最近提交 18 小时前SkillHot 收录 20 天前
▸ 精选理由

适合需要精确性能度量的开发者,避免常见基准陷阱。

这个 Skill 做什么

围绕 BenchmarkDotNet 编写、配置与运行 .NET 微基准的指导规范。

用 BenchmarkDotNet(BDN)帮你精确测小段 .NET 代码的执行速度和内存开销,适合需要量化微观性能差异的时候。会教你怎么设计微基准、配置 BDN 的 Job/Runtime、搭建项目并高效运行对比测试。特别在于能做可复现的“逐项对比”测量,别用它做性能剖析(profiling)或压力测试。

▸ 展开 SKILL.md 英文原文

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 performance comparisons. Do NOT use for profiling/tracing .NET code (dotnet-trace, PerfView), production telemetry, or load/stress testing (Crank, k6).

开发编程基准测试BenchmarkDotNet性能通用
4.8k
Stars
351
Forks
40
仓库内 Skill
+610
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/dotnet/skills/main/plugins/dotnet-diag/skills/microbenchmarking/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/dotnet/skills/main/plugins/dotnet-diag/skills/microbenchmarking/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# Benchmark Authoring Guidelines

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.

## Key concepts

- 
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有