Code cleanup
This commit is contained in:
Родитель
f8ab51870b
Коммит
b912a8e702
|
@ -7,12 +7,12 @@ namespace BenchmarkDotNet.Samples
|
||||||
public class IntroComparableComplexParam
|
public class IntroComparableComplexParam
|
||||||
{
|
{
|
||||||
[ParamsSource(nameof(ValuesForA))]
|
[ParamsSource(nameof(ValuesForA))]
|
||||||
public ComplexParam A { get; set; }
|
public ComplexParam? A { get; set; }
|
||||||
|
|
||||||
public IEnumerable<ComplexParam> ValuesForA => new[] { new ComplexParam(1, "First"), new ComplexParam(2, "Second") };
|
public IEnumerable<ComplexParam> ValuesForA => new[] { new ComplexParam(1, "First"), new ComplexParam(2, "Second") };
|
||||||
|
|
||||||
[Benchmark]
|
[Benchmark]
|
||||||
public object Benchmark() => A;
|
public object? Benchmark() => A;
|
||||||
|
|
||||||
// Only non generic IComparable is required to provide custom order behavior, but implementing IComparable<> too is customary.
|
// Only non generic IComparable is required to provide custom order behavior, but implementing IComparable<> too is customary.
|
||||||
public class ComplexParam : IComparable<ComplexParam>, IComparable
|
public class ComplexParam : IComparable<ComplexParam>, IComparable
|
||||||
|
@ -29,7 +29,7 @@ namespace BenchmarkDotNet.Samples
|
||||||
|
|
||||||
public override string ToString() => Name;
|
public override string ToString() => Name;
|
||||||
|
|
||||||
public int CompareTo(ComplexParam other) => other == null ? 1 : Value.CompareTo(other.Value);
|
public int CompareTo(ComplexParam? other) => other == null ? 1 : Value.CompareTo(other.Value);
|
||||||
|
|
||||||
public int CompareTo(object obj) => obj is ComplexParam other ? CompareTo(other) : throw new ArgumentException();
|
public int CompareTo(object obj) => obj is ComplexParam other ? CompareTo(other) : throw new ArgumentException();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using BenchmarkDotNet.Attributes;
|
using BenchmarkDotNet.Attributes;
|
||||||
using BenchmarkDotNet.Diagnosers;
|
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Samples
|
namespace BenchmarkDotNet.Samples
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,23 +8,23 @@ namespace BenchmarkDotNet.Samples
|
||||||
[Params(512 * 4)]
|
[Params(512 * 4)]
|
||||||
public int Size;
|
public int Size;
|
||||||
|
|
||||||
private int[] _array;
|
private int[] array;
|
||||||
private int[] _destination;
|
private int[] destination;
|
||||||
|
|
||||||
[GlobalSetup]
|
[GlobalSetup]
|
||||||
public void Setup()
|
public void Setup()
|
||||||
{
|
{
|
||||||
_array = new int[Size];
|
array = new int[Size];
|
||||||
_destination = new int[Size];
|
destination = new int[Size];
|
||||||
}
|
}
|
||||||
|
|
||||||
[Benchmark]
|
[Benchmark]
|
||||||
[MemoryRandomization(false)]
|
[MemoryRandomization(false)]
|
||||||
public void Array_RandomizationDisabled() => Array.Copy(_array, _destination, Size);
|
public void Array_RandomizationDisabled() => Array.Copy(array, destination, Size);
|
||||||
|
|
||||||
[Benchmark]
|
[Benchmark]
|
||||||
[MemoryRandomization(true)]
|
[MemoryRandomization(true)]
|
||||||
[MaxIterationCount(40)] // the benchmark becomes multimodal and need a lower limit of max iterations than the default
|
[MaxIterationCount(40)] // the benchmark becomes multimodal and need a lower limit of max iterations than the default
|
||||||
public void Array_RandomizationEnabled() => Array.Copy(_array, _destination, Size);
|
public void Array_RandomizationEnabled() => Array.Copy(array, destination, Size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ using BenchmarkDotNet.Configs;
|
||||||
using BenchmarkDotNet.Environments;
|
using BenchmarkDotNet.Environments;
|
||||||
using BenchmarkDotNet.Jobs;
|
using BenchmarkDotNet.Jobs;
|
||||||
using BenchmarkDotNet.Running;
|
using BenchmarkDotNet.Running;
|
||||||
using System.IO;
|
|
||||||
using BenchmarkDotNet.Toolchains;
|
using BenchmarkDotNet.Toolchains;
|
||||||
using BenchmarkDotNet.Toolchains.DotNetCli;
|
using BenchmarkDotNet.Toolchains.DotNetCli;
|
||||||
using BenchmarkDotNet.Toolchains.MonoWasm;
|
using BenchmarkDotNet.Toolchains.MonoWasm;
|
||||||
|
|
|
@ -9,17 +9,17 @@ namespace BenchmarkDotNet.Attributes
|
||||||
public Type[] GenericTypeArguments { get; }
|
public Type[] GenericTypeArguments { get; }
|
||||||
|
|
||||||
public GenericTypeArgumentsAttribute([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type)
|
public GenericTypeArgumentsAttribute([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type)
|
||||||
=> GenericTypeArguments = new Type[] { type };
|
=> GenericTypeArguments = new[] { type };
|
||||||
|
|
||||||
public GenericTypeArgumentsAttribute(
|
public GenericTypeArgumentsAttribute(
|
||||||
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type1,
|
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type1,
|
||||||
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type2)
|
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type2)
|
||||||
=> GenericTypeArguments = new Type[] { type1, type2 };
|
=> GenericTypeArguments = new[] { type1, type2 };
|
||||||
|
|
||||||
public GenericTypeArgumentsAttribute(
|
public GenericTypeArgumentsAttribute(
|
||||||
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type1,
|
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type1,
|
||||||
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type2,
|
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type2,
|
||||||
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type3)
|
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type3)
|
||||||
=> GenericTypeArguments = new Type[] { type1, type2, type3 };
|
=> GenericTypeArguments = new[] { type1, type2, type3 };
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -9,7 +9,7 @@ namespace BenchmarkDotNet.Attributes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class TargetedAttribute : Attribute
|
public abstract class TargetedAttribute : Attribute
|
||||||
{
|
{
|
||||||
public string[] Targets { get; set; }
|
public string[] Targets { get; set; } = new string[0];
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Target method for attribute
|
/// Target method for attribute
|
||||||
|
|
|
@ -11,9 +11,7 @@ using BenchmarkDotNet.Reports;
|
||||||
using BenchmarkDotNet.Running;
|
using BenchmarkDotNet.Running;
|
||||||
using BenchmarkDotNet.Validators;
|
using BenchmarkDotNet.Validators;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Microsoft.Diagnostics.Tracing;
|
|
||||||
using Microsoft.Diagnostics.Tracing.Parsers;
|
using Microsoft.Diagnostics.Tracing.Parsers;
|
||||||
using Microsoft.Diagnostics.Tracing.Session;
|
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Diagnostics.Windows
|
namespace BenchmarkDotNet.Diagnostics.Windows
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Immutable;
|
using System.Collections.Immutable;
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using BenchmarkDotNet.Analysers;
|
using BenchmarkDotNet.Analysers;
|
||||||
using BenchmarkDotNet.Diagnosers;
|
using BenchmarkDotNet.Diagnosers;
|
||||||
using BenchmarkDotNet.Engines;
|
using BenchmarkDotNet.Engines;
|
||||||
using BenchmarkDotNet.Exporters;
|
using BenchmarkDotNet.Exporters;
|
||||||
using BenchmarkDotNet.Extensions;
|
|
||||||
using BenchmarkDotNet.Jobs;
|
using BenchmarkDotNet.Jobs;
|
||||||
using BenchmarkDotNet.Loggers;
|
using BenchmarkDotNet.Loggers;
|
||||||
using BenchmarkDotNet.Portability;
|
using BenchmarkDotNet.Portability;
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using BenchmarkDotNet.Diagnosers;
|
using BenchmarkDotNet.Diagnosers;
|
||||||
using BenchmarkDotNet.Helpers;
|
|
||||||
using BenchmarkDotNet.Loggers;
|
using BenchmarkDotNet.Loggers;
|
||||||
using JetBrains.Profiler.SelfApi;
|
using JetBrains.Profiler.SelfApi;
|
||||||
using ILogger = BenchmarkDotNet.Loggers.ILogger;
|
using ILogger = BenchmarkDotNet.Loggers.ILogger;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
using BenchmarkDotNet.Reports;
|
using BenchmarkDotNet.Reports;
|
||||||
using JetBrains.Annotations;
|
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Analysers
|
namespace BenchmarkDotNet.Analysers
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using BenchmarkDotNet.Engines;
|
using BenchmarkDotNet.Engines;
|
||||||
using BenchmarkDotNet.Reports;
|
using BenchmarkDotNet.Reports;
|
||||||
using JetBrains.Annotations;
|
|
||||||
using Perfolizer.Mathematics.Multimodality;
|
using Perfolizer.Mathematics.Multimodality;
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Analysers
|
namespace BenchmarkDotNet.Analysers
|
||||||
|
|
|
@ -5,7 +5,6 @@ using BenchmarkDotNet.Diagnosers;
|
||||||
using BenchmarkDotNet.Mathematics;
|
using BenchmarkDotNet.Mathematics;
|
||||||
using BenchmarkDotNet.Reports;
|
using BenchmarkDotNet.Reports;
|
||||||
using BenchmarkDotNet.Running;
|
using BenchmarkDotNet.Running;
|
||||||
using JetBrains.Annotations;
|
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Columns
|
namespace BenchmarkDotNet.Columns
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,7 +4,6 @@ using System.Linq;
|
||||||
using BenchmarkDotNet.Mathematics;
|
using BenchmarkDotNet.Mathematics;
|
||||||
using BenchmarkDotNet.Reports;
|
using BenchmarkDotNet.Reports;
|
||||||
using BenchmarkDotNet.Running;
|
using BenchmarkDotNet.Running;
|
||||||
using JetBrains.Annotations;
|
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Columns
|
namespace BenchmarkDotNet.Columns
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
|
||||||
using BenchmarkDotNet.Analysers;
|
using BenchmarkDotNet.Analysers;
|
||||||
using BenchmarkDotNet.Columns;
|
using BenchmarkDotNet.Columns;
|
||||||
using BenchmarkDotNet.Diagnosers;
|
using BenchmarkDotNet.Diagnosers;
|
||||||
|
@ -10,7 +9,6 @@ using BenchmarkDotNet.Filters;
|
||||||
using BenchmarkDotNet.Jobs;
|
using BenchmarkDotNet.Jobs;
|
||||||
using BenchmarkDotNet.Loggers;
|
using BenchmarkDotNet.Loggers;
|
||||||
using BenchmarkDotNet.Order;
|
using BenchmarkDotNet.Order;
|
||||||
using BenchmarkDotNet.Portability;
|
|
||||||
using BenchmarkDotNet.Reports;
|
using BenchmarkDotNet.Reports;
|
||||||
using BenchmarkDotNet.Running;
|
using BenchmarkDotNet.Running;
|
||||||
using BenchmarkDotNet.Toolchains.InProcess.Emit;
|
using BenchmarkDotNet.Toolchains.InProcess.Emit;
|
||||||
|
|
|
@ -12,7 +12,6 @@ using BenchmarkDotNet.Order;
|
||||||
using BenchmarkDotNet.Reports;
|
using BenchmarkDotNet.Reports;
|
||||||
using BenchmarkDotNet.Running;
|
using BenchmarkDotNet.Running;
|
||||||
using BenchmarkDotNet.Validators;
|
using BenchmarkDotNet.Validators;
|
||||||
using JetBrains.Annotations;
|
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Configs
|
namespace BenchmarkDotNet.Configs
|
||||||
{
|
{
|
||||||
|
|
|
@ -131,7 +131,7 @@ namespace BenchmarkDotNet.Configs
|
||||||
AddWarning($"The exporter {exporterType} of {diagnoser.GetType().Name} is already present in configuration. There may be unexpected results.");
|
AddWarning($"The exporter {exporterType} of {diagnoser.GetType().Name} is already present in configuration. There may be unexpected results.");
|
||||||
}
|
}
|
||||||
mergeDictionary[exporterType] = exporter;
|
mergeDictionary[exporterType] = exporter;
|
||||||
};
|
}
|
||||||
|
|
||||||
var result = mergeDictionary.Values.ToList();
|
var result = mergeDictionary.Values.ToList();
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ using BenchmarkDotNet.Configs;
|
||||||
using BenchmarkDotNet.Exporters;
|
using BenchmarkDotNet.Exporters;
|
||||||
using BenchmarkDotNet.Extensions;
|
using BenchmarkDotNet.Extensions;
|
||||||
using BenchmarkDotNet.Running;
|
using BenchmarkDotNet.Running;
|
||||||
using JetBrains.Annotations;
|
|
||||||
|
|
||||||
namespace BenchmarkDotNet.ConsoleArguments
|
namespace BenchmarkDotNet.ConsoleArguments
|
||||||
{
|
{
|
||||||
|
|
|
@ -85,12 +85,12 @@ namespace BenchmarkDotNet.Disassemblers.Exporters
|
||||||
}
|
}
|
||||||
|
|
||||||
// call to a known method
|
// call to a known method
|
||||||
if (disassemblyResult.AddressToNameMapping.ContainsKey(referencedAddress))
|
if (disassemblyResult.AddressToNameMapping.TryGetValue(referencedAddress, out string? referencedName))
|
||||||
{
|
{
|
||||||
string comment = string.Empty;
|
string comment = string.Empty;
|
||||||
if (asm.IsReferencedAddressIndirect)
|
if (asm.IsReferencedAddressIndirect)
|
||||||
{
|
{
|
||||||
comment = "; " + disassemblyResult.AddressToNameMapping[referencedAddress];
|
comment = "; " + referencedName;
|
||||||
}
|
}
|
||||||
prettified.Add(new Element(CodeFormatter.Format(asm, formatterWithGlobalSymbols, config.PrintInstructionAddresses, disassemblyResult.PointerSize, disassemblyResult.AddressToNameMapping) + comment, asm));
|
prettified.Add(new Element(CodeFormatter.Format(asm, formatterWithGlobalSymbols, config.PrintInstructionAddresses, disassemblyResult.PointerSize, disassemblyResult.AddressToNameMapping) + comment, asm));
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -10,7 +10,6 @@ using BenchmarkDotNet.Helpers;
|
||||||
using BenchmarkDotNet.Jobs;
|
using BenchmarkDotNet.Jobs;
|
||||||
using BenchmarkDotNet.Portability;
|
using BenchmarkDotNet.Portability;
|
||||||
using BenchmarkDotNet.Running;
|
using BenchmarkDotNet.Running;
|
||||||
using JetBrains.Annotations;
|
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Disassemblers
|
namespace BenchmarkDotNet.Disassemblers
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
|
|
@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||||
using BenchmarkDotNet.Environments;
|
using BenchmarkDotNet.Environments;
|
||||||
using BenchmarkDotNet.Jobs;
|
using BenchmarkDotNet.Jobs;
|
||||||
using BenchmarkDotNet.Reports;
|
using BenchmarkDotNet.Reports;
|
||||||
using JetBrains.Annotations;
|
|
||||||
using Perfolizer.Horology;
|
using Perfolizer.Horology;
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Engines
|
namespace BenchmarkDotNet.Engines
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using BenchmarkDotNet.Reports;
|
using BenchmarkDotNet.Reports;
|
||||||
using JetBrains.Annotations;
|
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Engines
|
namespace BenchmarkDotNet.Engines
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,6 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using BenchmarkDotNet.Reports;
|
using BenchmarkDotNet.Reports;
|
||||||
using JetBrains.Annotations;
|
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Engines
|
namespace BenchmarkDotNet.Engines
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
using JetBrains.Annotations;
|
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Engines
|
namespace BenchmarkDotNet.Engines
|
||||||
{
|
{
|
||||||
public struct StoppingResult
|
public struct StoppingResult
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime;
|
using System.Runtime;
|
||||||
using BenchmarkDotNet.Engines;
|
using BenchmarkDotNet.Engines;
|
||||||
|
|
|
@ -2,7 +2,6 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using JetBrains.Annotations;
|
|
||||||
using BenchmarkDotNet.Extensions;
|
using BenchmarkDotNet.Extensions;
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Environments
|
namespace BenchmarkDotNet.Environments
|
||||||
|
|
|
@ -120,8 +120,8 @@ namespace BenchmarkDotNet.Environments
|
||||||
[SuppressMessage("ReSharper", "StringLiteralTypo")]
|
[SuppressMessage("ReSharper", "StringLiteralTypo")]
|
||||||
internal static string? ParseIntelCoreMicroarchitecture(string modelNumber)
|
internal static string? ParseIntelCoreMicroarchitecture(string modelNumber)
|
||||||
{
|
{
|
||||||
if (KnownMicroarchitectures.Value.ContainsKey(modelNumber))
|
if (KnownMicroarchitectures.Value.TryGetValue(modelNumber, out string? microarchitecture))
|
||||||
return KnownMicroarchitectures.Value[modelNumber];
|
return microarchitecture;
|
||||||
|
|
||||||
if (modelNumber.Length >= 3 && modelNumber.Substring(0, 3).All(char.IsDigit) &&
|
if (modelNumber.Length >= 3 && modelNumber.Substring(0, 3).All(char.IsDigit) &&
|
||||||
(modelNumber.Length == 3 || !char.IsDigit(modelNumber[3])))
|
(modelNumber.Length == 3 || !char.IsDigit(modelNumber[3])))
|
||||||
|
|
|
@ -158,7 +158,7 @@ namespace BenchmarkDotNet.Environments
|
||||||
if (productName.IndexOf(".NET Framework", StringComparison.OrdinalIgnoreCase) >= 0)
|
if (productName.IndexOf(".NET Framework", StringComparison.OrdinalIgnoreCase) >= 0)
|
||||||
{
|
{
|
||||||
const string releaseVersionPrefix = "release/";
|
const string releaseVersionPrefix = "release/";
|
||||||
int releaseVersionIndex = productVersion.IndexOf(releaseVersionPrefix);
|
int releaseVersionIndex = productVersion.IndexOf(releaseVersionPrefix, StringComparison.Ordinal);
|
||||||
if (releaseVersionIndex > 0)
|
if (releaseVersionIndex > 0)
|
||||||
{
|
{
|
||||||
string releaseVersion = GetParsableVersionPart(productVersion.Substring(releaseVersionIndex + releaseVersionPrefix.Length));
|
string releaseVersion = GetParsableVersionPart(productVersion.Substring(releaseVersionIndex + releaseVersionPrefix.Length));
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using JetBrains.Annotations;
|
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Exporters.Csv
|
namespace BenchmarkDotNet.Exporters.Csv
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using BenchmarkDotNet.Helpers;
|
using BenchmarkDotNet.Helpers;
|
||||||
using JetBrains.Annotations;
|
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Extensions
|
namespace BenchmarkDotNet.Extensions
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,7 +11,6 @@ using BenchmarkDotNet.Loggers;
|
||||||
using BenchmarkDotNet.Portability;
|
using BenchmarkDotNet.Portability;
|
||||||
using BenchmarkDotNet.Running;
|
using BenchmarkDotNet.Running;
|
||||||
using BenchmarkDotNet.Toolchains.CoreRun;
|
using BenchmarkDotNet.Toolchains.CoreRun;
|
||||||
using BenchmarkDotNet.Toolchains.MonoAotLLVM;
|
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
using System;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using BenchmarkDotNet.Exporters;
|
using BenchmarkDotNet.Exporters;
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
using JetBrains.Annotations;
|
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Helpers
|
namespace BenchmarkDotNet.Helpers
|
||||||
{
|
{
|
||||||
internal static class AsciiHelper
|
internal static class AsciiHelper
|
||||||
|
|
|
@ -39,17 +39,17 @@ namespace BenchmarkDotNet.Helpers
|
||||||
internal static string MapToReleaseVersion(string servicingVersion)
|
internal static string MapToReleaseVersion(string servicingVersion)
|
||||||
{
|
{
|
||||||
// the following code assumes that .NET 4.6.1 is the oldest supported version
|
// the following code assumes that .NET 4.6.1 is the oldest supported version
|
||||||
if (string.Compare(servicingVersion, "4.6.2") < 0)
|
if (string.CompareOrdinal(servicingVersion, "4.6.2") < 0)
|
||||||
return "4.6.1";
|
return "4.6.1";
|
||||||
if (string.Compare(servicingVersion, "4.7") < 0)
|
if (string.CompareOrdinal(servicingVersion, "4.7") < 0)
|
||||||
return "4.6.2";
|
return "4.6.2";
|
||||||
if (string.Compare(servicingVersion, "4.7.1") < 0)
|
if (string.CompareOrdinal(servicingVersion, "4.7.1") < 0)
|
||||||
return "4.7";
|
return "4.7";
|
||||||
if (string.Compare(servicingVersion, "4.7.2") < 0)
|
if (string.CompareOrdinal(servicingVersion, "4.7.2") < 0)
|
||||||
return "4.7.1";
|
return "4.7.1";
|
||||||
if (string.Compare(servicingVersion, "4.8") < 0)
|
if (string.CompareOrdinal(servicingVersion, "4.8") < 0)
|
||||||
return "4.7.2";
|
return "4.7.2";
|
||||||
if (string.Compare(servicingVersion, "4.8.9") < 0)
|
if (string.CompareOrdinal(servicingVersion, "4.8.9") < 0)
|
||||||
return "4.8";
|
return "4.8";
|
||||||
|
|
||||||
return "4.8.1"; // most probably the last major release of Full .NET Framework
|
return "4.8.1"; // most probably the last major release of Full .NET Framework
|
||||||
|
|
|
@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||||
using System.Collections.Immutable;
|
using System.Collections.Immutable;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using BenchmarkDotNet.Loggers;
|
using BenchmarkDotNet.Loggers;
|
||||||
using JetBrains.Annotations;
|
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Helpers
|
namespace BenchmarkDotNet.Helpers
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using JetBrains.Annotations;
|
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Helpers
|
namespace BenchmarkDotNet.Helpers
|
||||||
{
|
{
|
||||||
|
|
|
@ -165,7 +165,7 @@ namespace BenchmarkDotNet.Helpers
|
||||||
case TaskbarProgressState.Warning:
|
case TaskbarProgressState.Warning:
|
||||||
Console.Write("\x1b]9;4;4;0\x1b\\");
|
Console.Write("\x1b]9;4;4;0\x1b\\");
|
||||||
break;
|
break;
|
||||||
};
|
}
|
||||||
SetConsoleMode(consoleHandle, previousConsoleMode);
|
SetConsoleMode(consoleHandle, previousConsoleMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using JetBrains.Annotations;
|
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Jobs
|
namespace BenchmarkDotNet.Jobs
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
using BenchmarkDotNet.Characteristics;
|
using BenchmarkDotNet.Characteristics;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using System;
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Jobs
|
namespace BenchmarkDotNet.Jobs
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Jobs
|
namespace BenchmarkDotNet.Jobs
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using JetBrains.Annotations;
|
|
||||||
using Perfolizer.Mathematics.SignificanceTesting;
|
using Perfolizer.Mathematics.SignificanceTesting;
|
||||||
using Perfolizer.Mathematics.Thresholds;
|
using Perfolizer.Mathematics.Thresholds;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using BenchmarkDotNet.Helpers;
|
using BenchmarkDotNet.Helpers;
|
||||||
using JetBrains.Annotations;
|
|
||||||
using Perfolizer.Horology;
|
using Perfolizer.Horology;
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Portability.Cpu
|
namespace BenchmarkDotNet.Portability.Cpu
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
using BenchmarkDotNet.Helpers;
|
using BenchmarkDotNet.Helpers;
|
||||||
using JetBrains.Annotations;
|
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Portability.Cpu
|
namespace BenchmarkDotNet.Portability.Cpu
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using BenchmarkDotNet.Helpers;
|
using BenchmarkDotNet.Helpers;
|
||||||
using JetBrains.Annotations;
|
|
||||||
using Perfolizer.Horology;
|
using Perfolizer.Horology;
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Portability.Cpu
|
namespace BenchmarkDotNet.Portability.Cpu
|
||||||
|
|
|
@ -5,7 +5,6 @@ using System.Diagnostics.CodeAnalysis;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Management;
|
using System.Management;
|
||||||
using System.Numerics;
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using BenchmarkDotNet.Environments;
|
using BenchmarkDotNet.Environments;
|
||||||
using JetBrains.Annotations;
|
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Reports
|
namespace BenchmarkDotNet.Reports
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,7 +4,6 @@ using System.Linq;
|
||||||
using BenchmarkDotNet.Columns;
|
using BenchmarkDotNet.Columns;
|
||||||
using BenchmarkDotNet.Extensions;
|
using BenchmarkDotNet.Extensions;
|
||||||
using BenchmarkDotNet.Mathematics;
|
using BenchmarkDotNet.Mathematics;
|
||||||
using JetBrains.Annotations;
|
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Reports
|
namespace BenchmarkDotNet.Reports
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using BenchmarkDotNet.Engines;
|
using BenchmarkDotNet.Engines;
|
||||||
using BenchmarkDotNet.Helpers;
|
using BenchmarkDotNet.Helpers;
|
||||||
using BenchmarkDotNet.Loggers;
|
|
||||||
using Perfolizer.Horology;
|
using Perfolizer.Horology;
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Reports
|
namespace BenchmarkDotNet.Reports
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using BenchmarkDotNet.Columns;
|
using BenchmarkDotNet.Columns;
|
||||||
using BenchmarkDotNet.Helpers;
|
using BenchmarkDotNet.Helpers;
|
||||||
using JetBrains.Annotations;
|
|
||||||
using Perfolizer.Horology;
|
using Perfolizer.Horology;
|
||||||
|
|
||||||
// ReSharper disable MemberCanBePrivate.Global
|
// ReSharper disable MemberCanBePrivate.Global
|
||||||
|
|
|
@ -4,7 +4,6 @@ using System.Reflection;
|
||||||
using BenchmarkDotNet.Extensions;
|
using BenchmarkDotNet.Extensions;
|
||||||
using BenchmarkDotNet.Helpers;
|
using BenchmarkDotNet.Helpers;
|
||||||
using BenchmarkDotNet.Portability;
|
using BenchmarkDotNet.Portability;
|
||||||
using JetBrains.Annotations;
|
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Running
|
namespace BenchmarkDotNet.Running
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,7 +7,6 @@ using BenchmarkDotNet.Extensions;
|
||||||
using BenchmarkDotNet.Helpers;
|
using BenchmarkDotNet.Helpers;
|
||||||
using BenchmarkDotNet.Loggers;
|
using BenchmarkDotNet.Loggers;
|
||||||
using BenchmarkDotNet.Portability;
|
using BenchmarkDotNet.Portability;
|
||||||
using JetBrains.Annotations;
|
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Running
|
namespace BenchmarkDotNet.Running
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
using System;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.IO.Pipes;
|
using System.IO.Pipes;
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using BenchmarkDotNet.Engines;
|
using BenchmarkDotNet.Engines;
|
||||||
using JetBrains.Annotations;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
|
|
@ -15,7 +15,6 @@ using BenchmarkDotNet.Loggers;
|
||||||
using BenchmarkDotNet.Properties;
|
using BenchmarkDotNet.Properties;
|
||||||
using BenchmarkDotNet.Running;
|
using BenchmarkDotNet.Running;
|
||||||
using BenchmarkDotNet.Toolchains.Results;
|
using BenchmarkDotNet.Toolchains.Results;
|
||||||
using JetBrains.Annotations;
|
|
||||||
using static BenchmarkDotNet.Toolchains.InProcess.Emit.Implementation.RunnableConstants;
|
using static BenchmarkDotNet.Toolchains.InProcess.Emit.Implementation.RunnableConstants;
|
||||||
using static BenchmarkDotNet.Toolchains.InProcess.Emit.Implementation.RunnableReflectionHelpers;
|
using static BenchmarkDotNet.Toolchains.InProcess.Emit.Implementation.RunnableReflectionHelpers;
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,6 @@ using System.Threading.Tasks;
|
||||||
using BenchmarkDotNet.Extensions;
|
using BenchmarkDotNet.Extensions;
|
||||||
using BenchmarkDotNet.Running;
|
using BenchmarkDotNet.Running;
|
||||||
|
|
||||||
using JetBrains.Annotations;
|
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Toolchains.InProcess.NoEmit
|
namespace BenchmarkDotNet.Toolchains.InProcess.NoEmit
|
||||||
{
|
{
|
||||||
/// <summary>Helper class that creates <see cref="BenchmarkAction"/> instances. </summary>
|
/// <summary>Helper class that creates <see cref="BenchmarkAction"/> instances. </summary>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using BenchmarkDotNet.Configs;
|
|
||||||
using BenchmarkDotNet.Reports;
|
using BenchmarkDotNet.Reports;
|
||||||
|
|
||||||
namespace BenchmarkDotNet.Validators
|
namespace BenchmarkDotNet.Validators
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using BenchmarkDotNet.Running;
|
using BenchmarkDotNet.Running;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using BenchmarkDotNet.Analysers;
|
using BenchmarkDotNet.Analysers;
|
||||||
using BenchmarkDotNet.Attributes;
|
using BenchmarkDotNet.Attributes;
|
||||||
|
|
|
@ -5,7 +5,6 @@ using BenchmarkDotNet.Attributes;
|
||||||
using BenchmarkDotNet.Engines;
|
using BenchmarkDotNet.Engines;
|
||||||
using BenchmarkDotNet.Jobs;
|
using BenchmarkDotNet.Jobs;
|
||||||
using BenchmarkDotNet.Reports;
|
using BenchmarkDotNet.Reports;
|
||||||
using BenchmarkDotNet.Tests.Loggers;
|
|
||||||
using BenchmarkDotNet.Tests.XUnit;
|
using BenchmarkDotNet.Tests.XUnit;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
using Xunit.Abstractions;
|
using Xunit.Abstractions;
|
||||||
|
|
|
@ -9,7 +9,6 @@ using BenchmarkDotNet.Attributes;
|
||||||
using BenchmarkDotNet.Columns;
|
using BenchmarkDotNet.Columns;
|
||||||
using BenchmarkDotNet.Configs;
|
using BenchmarkDotNet.Configs;
|
||||||
using BenchmarkDotNet.Diagnosers;
|
using BenchmarkDotNet.Diagnosers;
|
||||||
using BenchmarkDotNet.Environments;
|
|
||||||
using BenchmarkDotNet.Extensions;
|
using BenchmarkDotNet.Extensions;
|
||||||
using BenchmarkDotNet.IntegrationTests.Xunit;
|
using BenchmarkDotNet.IntegrationTests.Xunit;
|
||||||
using BenchmarkDotNet.Jobs;
|
using BenchmarkDotNet.Jobs;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using BenchmarkDotNet.Attributes;
|
using BenchmarkDotNet.Attributes;
|
||||||
using BenchmarkDotNet.Tests.Loggers;
|
|
||||||
using Xunit;
|
using Xunit;
|
||||||
using Xunit.Abstractions;
|
using Xunit.Abstractions;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using BenchmarkDotNet.Attributes;
|
using BenchmarkDotNet.Attributes;
|
||||||
using BenchmarkDotNet.Jobs;
|
using BenchmarkDotNet.Jobs;
|
||||||
using BenchmarkDotNet.Tests.Loggers;
|
|
||||||
using BenchmarkDotNet.Tests.XUnit;
|
using BenchmarkDotNet.Tests.XUnit;
|
||||||
using BenchmarkDotNet.Toolchains.Roslyn;
|
using BenchmarkDotNet.Toolchains.Roslyn;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
using System;
|
using System.Linq;
|
||||||
using System.Linq;
|
|
||||||
using System.Threading;
|
|
||||||
using BenchmarkDotNet.Attributes;
|
using BenchmarkDotNet.Attributes;
|
||||||
using BenchmarkDotNet.Columns;
|
using BenchmarkDotNet.Columns;
|
||||||
using BenchmarkDotNet.Configs;
|
using BenchmarkDotNet.Configs;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
using BenchmarkDotNet.Attributes;
|
using BenchmarkDotNet.Attributes;
|
||||||
using BenchmarkDotNet.Engines;
|
using BenchmarkDotNet.Engines;
|
||||||
using BenchmarkDotNet.Jobs;
|
using BenchmarkDotNet.Jobs;
|
||||||
using BenchmarkDotNet.Tests.Loggers;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Xml.Linq;
|
|
||||||
using BenchmarkDotNet.Attributes;
|
using BenchmarkDotNet.Attributes;
|
||||||
using BenchmarkDotNet.Reports;
|
using BenchmarkDotNet.Reports;
|
||||||
using BenchmarkDotNet.Tests.Mocks;
|
using BenchmarkDotNet.Tests.Mocks;
|
||||||
using BenchmarkDotNet.Tests.Mocks.Toolchain;
|
|
||||||
using Xunit;
|
using Xunit;
|
||||||
using Xunit.Abstractions;
|
using Xunit.Abstractions;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using System.Linq;
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using BenchmarkDotNet.Attributes;
|
using BenchmarkDotNet.Attributes;
|
||||||
using BenchmarkDotNet.Filters;
|
using BenchmarkDotNet.Filters;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using BenchmarkDotNet.Characteristics;
|
using BenchmarkDotNet.Characteristics;
|
||||||
using BenchmarkDotNet.Engines;
|
using BenchmarkDotNet.Engines;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче