Loading...
Loading...
Compare original and translation side by side
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.
注意: 对大语言模型编写BenchmarkDotNet基准测试的评估显示,常见失败模式源于对BDN行为的过时假设——尤其是在运行时对比、作业配置和执行默认值方面,这些内容在新版本中已发生变化。本技能中的参考文件包含经过验证的最新信息。在编写任何代码之前,你必须阅读与任务相关的参考文件——你的训练数据可能包含过时或错误的BDN使用模式。
OperationsPerInvoke=NOperationsPerInvoke=N[Params][Params]| Preset | Per-case time | When to use |
|---|---|---|
| <1s | Validate correctness — confirms compilation and execution without measurement |
| 5–8s | Quick measurements during development or investigation |
| (default) | 15–25s | Final measurements for a coverage suite |
| 33–52s | Higher confidence when results matter |
| 3–12 min | High statistical confidence |
[Params][Params]| 预设 | 单案例耗时 | 适用场景 |
|---|---|---|
| <1秒 | 验证正确性——确认编译和执行正常,不进行测量 |
| 5-8秒 | 开发或调查期间的快速测量 |
| (默认) | 15-25秒 | 覆盖套件的最终测量 |
| 33-52秒 | 结果重要时的高可信度测量 |
| 3-12分钟 | 高统计可信度测量 |
BenchmarkSwitcherBenchmarkRunner--filter--runtimesargsBenchmarkSwitcher--filterBenchmarkSwitcherBenchmarkRunner--filter--runtimesargsargsBenchmarkSwitcher--filterdotnet run -c Release -- --filter "*MethodName" --noOverwrite > benchmark.log 2>&1--filter*-report-github.mdbenchmark.logdotnet run -c Release -- --filter "*MethodName" --noOverwrite > benchmark.log 2>&1--filter*-report-github.mdbenchmark.log[Params][ParamsSource][Arguments][ArgumentsSource][ParamsAllValues]bool[GenericTypeArguments][Params][ParamsSource][ArgumentsSource][GlobalSetup][Params][ParamsSource][Arguments][ArgumentsSource][ParamsAllValues]bool[GenericTypeArguments][Params][ParamsSource][ArgumentsSource][GlobalSetup]dotnet add package BenchmarkDotNet<PackageReference>.csproj[GlobalSetup][IterationSetup][Benchmark(Baseline = true)].AsBaseline()[Params]constdotnet add package BenchmarkDotNet.csproj<PackageReference>[GlobalSetup][IterationSetup][Benchmark(Baseline = true)].AsBaseline()[Params]const--job Dry--job Short--job Dry--job Short