Skip to content

Commit 978b16b

Browse files
committed
EvaluateOverhead command line option and docs
1 parent df0dfb7 commit 978b16b

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

docs/articles/configs/jobs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ If you want to change the accuracy level, you should use the following character
7070
* `MaxRelativeError`, `MaxAbsoluteError`: Maximum acceptable error for a benchmark (by default, BenchmarkDotNet continue iterations until the actual error is less than the specified error). *In these two characteristics*, the error means half of 99.9% confidence interval. `MaxAbsoluteError` is an absolute `TimeInterval`; doesn't have a default value. `MaxRelativeError` defines max acceptable (`(<half of CI 99.9%>) / Mean`).
7171
* `MinIterationTime`: Minimum time of a single iteration. Unlike `Run.IterationTime`, this characteristic specifies only the lower limit. In case of need, BenchmarkDotNet can increase this value.
7272
* `MinInvokeCount`: Minimum about of target method invocation. Default value if `4` but you can decrease this value for cases when single invocations takes a lot of time.
73-
* `EvaluateOverhead`: if your benchmark method takes nanoseconds, BenchmarkDotNet overhead can significantly affect measurements. If this characteristic is enabled, the overhead will be evaluated and subtracted from the result measurements. Default value is `true`.
73+
* `EvaluateOverhead`: if your benchmark method takes nanoseconds, BenchmarkDotNet overhead can significantly affect measurements. If this characteristic is enabled, the overhead will be evaluated and subtracted from the result measurements. Default value is `false`.
7474
* `WithOutlierMode`: sometimes you could have outliers in your measurements. Usually these are unexpected outliers which arose because of other processes activities. By default (`OutlierMode.RemoveUpper`), all upper outliers (which is larger than Q3) will be removed from the result measurements. However, some of benchmarks have *expected* outliers. In these situation, you expect that some of invocation can produce outliers measurements (e.g. in case of network activities, cache operations, and so on). If you want to see result statistics with these outliers, you should use `OutlierMode.DontRemove`. If you can also choose `OutlierMode.RemoveLower` (outliers which are smaller than Q1 will be removed) or `OutlierMode.RemoveAll` (all outliers will be removed). See also: @BenchmarkDotNet.Mathematics.OutlierMode
7575
* `AnalyzeLaunchVariance`: this characteristic makes sense only if `Run.LaunchCount` is default. If this mode is enabled and, BenchmarkDotNet will try to perform several launches and detect if there is a variance between launches. If this mode is disable, only one launch will be performed.
7676

docs/articles/guides/console-args.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ dotnet run -c Release -- --filter * --runtimes net6.0 net8.0 --statisticalTest 5
321321
* `--wasmDataDir` Wasm data directory
322322
* `--wasmCoreCLR` (Default: false) Use CoreCLR runtime pack (Microsoft.NETCore.App.Runtime.browser-wasm) instead of the Mono runtime pack for WASM benchmarks.
323323
* `--noForcedGCs` Specifying would not forcefully induce any GCs.
324-
* `--noOverheadEvaluation` Specifying would not run the evaluation overhead iterations.
324+
* `--evaluateOverhead` Specifies whether to run and evaluate overhead iterations.
325325
* `--resume` (Default: false) Continue the execution if the last run was stopped.
326326
* `--help` Display this help screen.
327327
* `--version` Display version information.

src/BenchmarkDotNet/ConsoleArguments/CommandLineOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ public bool UseDisassemblyDiagnoser
228228
[Option("noForcedGCs", Required = false, HelpText = "Specifying would not forcefully induce any GCs.")]
229229
public bool NoForcedGCs { get; set; }
230230

231-
[Option("noOverheadEvaluation", Required = false, HelpText = "Specifying would not run the evaluation overhead iterations.")]
232-
public bool NoEvaluationOverhead { get; set; }
231+
[Option("evaluateOverhead", Required = false, HelpText = "Specifies whether to run and evaluate overhead iterations.")]
232+
public bool? EvaluateOverhead { get; set; }
233233

234234
[Option("resume", Required = false, Default = false, HelpText = "Continue the execution if the last run was stopped.")]
235235
public bool Resume { get; set; }

src/BenchmarkDotNet/ConsoleArguments/ConfigParser.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,9 +443,9 @@ private static Job GetBaseJob(CommandLineOptions options, IConfig? globalConfig)
443443
baseJob = baseJob.WithMemoryRandomization();
444444
if (options.NoForcedGCs)
445445
baseJob = baseJob.WithGcForce(false);
446-
if (options.NoEvaluationOverhead)
446+
if (options.EvaluateOverhead is bool evaluateOverhead)
447447
#pragma warning disable CS0618 // Type or member is obsolete
448-
baseJob = baseJob.WithEvaluateOverhead(false);
448+
baseJob = baseJob.WithEvaluateOverhead(evaluateOverhead);
449449
#pragma warning restore CS0618 // Type or member is obsolete
450450

451451
if (options.EnvironmentVariables.Any())

tests/BenchmarkDotNet.Tests/ConfigParserTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -683,15 +683,15 @@ public void UserCanSpecifyNoForceGCs()
683683
}
684684

685685
[Fact]
686-
public void UsersCanSpecifyWithoutOverheadEvalution()
686+
public void UsersCanSpecifyEvaluateOverhead()
687687
{
688-
var parsedConfiguration = ConfigParser.Parse(["--noOverheadEvaluation"], new OutputLogger(Output));
688+
var parsedConfiguration = ConfigParser.Parse(["--evaluateOverhead", "true"], new OutputLogger(Output));
689689
Assert.NotNull(parsedConfiguration.config);
690690
Assert.True(parsedConfiguration.isSuccess);
691691

692692
foreach (var job in parsedConfiguration.config.GetJobs())
693693
{
694-
Assert.False(job.Accuracy.EvaluateOverhead);
694+
Assert.True(job.Accuracy.EvaluateOverhead);
695695
}
696696
}
697697

0 commit comments

Comments
 (0)