Exemplo n.º 1
0
 /// <summary>
 /// Maximum acceptable error for a benchmark (by default, BenchmarkDotNet continue iterations until the actual error is less than the specified error).
 /// Doesn't have a default value.
 /// <remarks>If <see cref="AccuracyMode.MaxRelativeError"/> is also provided, the smallest value is used as stop criteria.</remarks>
 /// </summary>
 public static Job WithMaxAbsoluteError(this Job job, TimeInterval interval) => job.WithCore(j => j.Accuracy.MaxAbsoluteError = interval);
Exemplo n.º 2
0
 /// <summary>
 /// Invocation count in a single iteration.
 /// If specified, <see cref="RunMode.IterationTime"/> will be ignored.
 /// If specified, it must be a multiple of <see cref="RunMode.UnrollFactor"/>.
 /// </summary>
 public static Job WithInvocationCount(this Job job, int count) => job.WithCore(j => j.Run.InvocationCount = count);
Exemplo n.º 3
0
 /// <summary>
 /// Maximum count of target iterations that should be performed.
 /// The default value is 100.
 /// <remarks>If you set this value to below 15, then <see cref="MultimodalDistributionAnalyzer"/>  is not going to work.</remarks>
 /// </summary>
 public static Job WithMaxIterationCount(this Job job, int count) => job.WithCore(j => j.Run.MaxIterationCount = count);
Exemplo n.º 4
0
        public static Job With(this Job job, RunStrategy strategy) => job.WithCore(j => j.Run.RunStrategy = strategy);        // Run

        /// <summary>
        /// Available values: Throughput, ColdStart and Monitoring.
        ///     Throughput: default strategy which allows to get good precision level.
        ///     ColdStart: should be used only for measuring cold start of the application or testing purpose.
        ///     Monitoring: no overhead evaluating, with several target iterations. Perfect for macrobenchmarks without a steady state with high variance.
        /// </summary>
        public static Job WithStrategy(this Job job, RunStrategy strategy) => job.WithCore(j => j.Run.RunStrategy = strategy);
Exemplo n.º 5
0
 /// <summary>
 /// How many warmup iterations should be performed.
 /// </summary>
 public static Job WithWarmupCount(this Job job, int count) => job.WithCore(j => j.Run.WarmupCount = count);
Exemplo n.º 6
0
 public static Job WithHeapCount(this Job job, int heapCount) => job.WithCore(j => j.Environment.Gc.HeapCount = heapCount);
Exemplo n.º 7
0
 public static Job WithHeapAffinitizeMask(this Job job, int heapAffinitizeMask) =>
 job.WithCore(j => j.Environment.Gc.HeapAffinitizeMask = heapAffinitizeMask);
Exemplo n.º 8
0
 // Meta
 public static Job AsBaseline(this Job job) => job.WithCore(j => j.Meta.Baseline = true);
Exemplo n.º 9
0
 /// <summary>
 /// ProcessorAffinity for the benchmark process.
 /// See also: https://msdn.microsoft.com/library/system.diagnostics.process.processoraffinity.aspx
 /// </summary>
 public static Job WithAffinity(this Job job, IntPtr affinity) => job.WithCore(j => j.Environment.Affinity = affinity);
Exemplo n.º 10
0
 /// <summary>
 /// Specifies which outliers should be removed from the distribution
 /// </summary>
 public static Job WithOutlierMode(this Job job, OutlierMode value) => job.WithCore(j => j.Accuracy.OutlierMode = value);
Exemplo n.º 11
0
 public static Job WithAnalyzeLaunchVariance(this Job job, bool value) => job.WithCore(j => j.Accuracy.AnalyzeLaunchVariance = value);
Exemplo n.º 12
0
 /// <summary>
 /// Specifies if the overhead should be evaluated (Idle runs) and it's average value subtracted from every result.
 /// True by default, very important for nano-benchmarks.
 /// </summary>
 public static Job WithEvaluateOverhead(this Job job, bool value) => job.WithCore(j => j.Accuracy.EvaluateOverhead = value);
Exemplo n.º 13
0
 /// <summary>
 /// Minimum count of benchmark invocations per iteration
 /// The default value is 4.
 /// </summary>
 public static Job WithMinInvokeCount(this Job job, int value) => job.WithCore(j => j.Accuracy.MinInvokeCount = value);
Exemplo n.º 14
0
 /// <summary>
 /// 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.
 /// The default value is 500 milliseconds.
 /// </summary>
 public static Job WithMinIterationTime(this Job job, TimeInterval interval) => job.WithCore(j => j.Accuracy.MinIterationTime = interval);
Exemplo n.º 15
0
 /// <summary>
 /// On 64-bit platforms, enables arrays that are greater than 2 gigabytes (GB) in total size.
 /// <value>false: Arrays greater than 2 GB in total size are not enabled. This is the default.</value>
 /// <value>true: Arrays greater than 2 GB in total size are enabled on 64-bit platforms.</value>
 /// </summary>
 public static Job WithGcAllowVeryLargeObjects(this Job job, bool value) => job.WithCore(j => j.Environment.Gc.AllowVeryLargeObjects = value);
Exemplo n.º 16
0
 public static Job WithBaseline(this Job job, bool value) => job.WithCore(j => j.Meta.Baseline = value);
Exemplo n.º 17
0
 public static Job WithGcRetainVm(this Job job, bool value) => job.WithCore(j => j.Environment.Gc.RetainVm = value);
Exemplo n.º 18
0
 /// <summary>
 /// mutator job should not be added to the config, but instead applied to other jobs in given config
 /// </summary>
 public static Job AsMutator(this Job job) => job.WithCore(j => j.Meta.IsMutator = true);
Exemplo n.º 19
0
 public static Job WithNoAffinitize(this Job job, bool value) => job.WithCore(j => j.Environment.Gc.NoAffinitize = value);
Exemplo n.º 20
0
 /// <summary>
 /// use it if you want to specify custom default settings for default job used by console arguments parser
 /// </summary>
 public static Job AsDefault(this Job job, bool value = true) => job.WithCore(j => j.Meta.IsDefault = value);
Exemplo n.º 21
0
 public static Job WithGcMode(this Job job, GcMode gc) => job.WithCore(j => EnvironmentMode.GcCharacteristic[j] = gc);
Exemplo n.º 22
0
 /// <summary>
 /// Specifies whether the common language runtime runs server garbage collection.
 /// <value>false: Does not run server garbage collection. This is the default.</value>
 /// <value>true: Runs server garbage collection.</value>
 /// </summary>
 public static Job WithGcServer(this Job job, bool value) => job.WithCore(j => j.Environment.Gc.Server = value);
Exemplo n.º 23
0
 /// <summary>
 /// How many times we should launch process with target benchmark.
 /// </summary>
 public static Job WithLaunchCount(this Job job, int count) => job.WithCore(j => j.Run.LaunchCount = count);
Exemplo n.º 24
0
 /// <summary>
 /// Specifies whether the common language runtime runs garbage collection on a separate thread.
 /// <value>false: Does not run garbage collection concurrently.</value>
 /// <value>true: Runs garbage collection concurrently. This is the default.</value>
 /// </summary>
 public static Job WithGcConcurrent(this Job job, bool value) => job.WithCore(j => j.Environment.Gc.Concurrent = value);
Exemplo n.º 25
0
 /// <summary>
 /// Desired time of execution of an iteration. Used by Pilot stage to estimate the number of invocations per iteration.
 /// The default value is 500 milliseconds.
 /// </summary>
 public static Job WithIterationTime(this Job job, TimeInterval time) => job.WithCore(j => j.Run.IterationTime = time);
Exemplo n.º 26
0
 public static Job WithGcCpuGroups(this Job job, bool value) => job.WithCore(j => j.Environment.Gc.CpuGroups = value);
Exemplo n.º 27
0
 /// <summary>
 /// How many times the benchmark method will be invoked per one iteration of a generated loop.
 /// The default value is 16.
 /// </summary>
 public static Job WithUnrollFactor(this Job job, int factor) => job.WithCore(j => j.Run.UnrollFactor = factor);
Exemplo n.º 28
0
 /// <summary>
 /// Specifies whether the BenchmarkDotNet's benchmark runner forces full garbage collection after each benchmark invocation
 /// <value>false: Does not force garbage collection.</value>
 /// <value>true: Forces full garbage collection after each benchmark invocation. This is the default.</value>
 /// </summary>
 public static Job WithGcForce(this Job job, bool value) => job.WithCore(j => j.Environment.Gc.Force = value);
Exemplo n.º 29
0
 public static Job WithPlatform(this Job job, Platform platform) => job.WithCore(j => j.Environment.Platform = platform);
Exemplo n.º 30
0
 // Accuracy
 /// <summary>
 /// Maximum acceptable error for a benchmark (by default, BenchmarkDotNet continue iterations until the actual error is less than the specified error).
 /// The default value is 0.02.
 /// <remarks>If <see cref="AccuracyMode.MaxAbsoluteError"/> is also provided, the smallest value is used as stop criteria.</remarks>
 /// </summary>
 public static Job WithMaxRelativeError(this Job job, double value) => job.WithCore(j => j.Accuracy.MaxRelativeError = value);