Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/Attributes/ConfigAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using BenchmarkDotNet.Configs;

#nullable enable

namespace BenchmarkDotNet.Attributes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Assembly)]
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/Attributes/Jobs/SimpleJobAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
using BenchmarkDotNet.Jobs;
using JetBrains.Annotations;

#nullable enable

namespace BenchmarkDotNet.Attributes
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Assembly, AllowMultiple = true)]
Expand Down
1 change: 1 addition & 0 deletions src/BenchmarkDotNet/BenchmarkDotNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<RootNamespace>BenchmarkDotNet</RootNamespace>
<!-- needed for docfx xref resolver -->
<ProduceReferenceAssembly>True</ProduceReferenceAssembly>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Templates\*" Exclude="bin\**;obj\**;**\*.xproj;packages\**;@(EmbeddedResource)" />
Expand Down
4 changes: 1 addition & 3 deletions src/BenchmarkDotNet/Characteristics/Characteristic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
using System.Diagnostics.CodeAnalysis;
using static BenchmarkDotNet.Characteristics.CharacteristicHelper;

#nullable enable

namespace BenchmarkDotNet.Characteristics
{
public abstract class Characteristic
Expand Down Expand Up @@ -96,7 +94,7 @@ public object? this[CharacteristicObject obj]

public bool HasChildCharacteristics => IsCharacteristicObjectSubclass(CharacteristicType);

internal virtual object? ResolveValueCore(CharacteristicObject obj, object currentValue) =>
internal virtual object? ResolveValueCore(CharacteristicObject obj, object? currentValue) =>
ReferenceEquals(currentValue, EmptyValue) ? FallbackValue : currentValue;

public override string ToString() => Id;
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/Characteristics/CharacteristicHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
using System.Reflection;
using JetBrains.Annotations;

#nullable enable

namespace BenchmarkDotNet.Characteristics
{
public static class CharacteristicHelper
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/Characteristics/CharacteristicObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
using BenchmarkDotNet.Extensions;
using JetBrains.Annotations;

#nullable enable

namespace BenchmarkDotNet.Characteristics
{
// TODO: better naming.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
using BenchmarkDotNet.Helpers;
using BenchmarkDotNet.Jobs;

#nullable enable

namespace BenchmarkDotNet.Characteristics
{
public abstract class CharacteristicPresenter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
using System.Collections.Generic;
using System.Linq;

#nullable enable

namespace BenchmarkDotNet.Characteristics
{
public abstract class CharacteristicSetPresenter
Expand Down
4 changes: 1 addition & 3 deletions src/BenchmarkDotNet/Characteristics/Characteristic`1.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using System.Diagnostics.CodeAnalysis;

#nullable enable

namespace BenchmarkDotNet.Characteristics
{
public class Characteristic<[DynamicallyAccessedMembers(CharacteristicObject.CharacteristicMemberTypes)] T> : Characteristic
Expand Down Expand Up @@ -30,7 +28,7 @@ internal Characteristic(
set { obj.SetValue(this, value); }
}

internal override object? ResolveValueCore(CharacteristicObject obj, object currentValue)
internal override object? ResolveValueCore(CharacteristicObject obj, object? currentValue)
{
if (Resolver == null)
return (T?)base.ResolveValueCore(obj, currentValue);
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/Characteristics/CompositeResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;

#nullable enable

namespace BenchmarkDotNet.Characteristics
{
public class CompositeResolver : IResolver
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/Characteristics/IResolver.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System.Diagnostics.CodeAnalysis;

#nullable enable

namespace BenchmarkDotNet.Characteristics
{
/// <summary>
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/Characteristics/Resolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;

#nullable enable

namespace BenchmarkDotNet.Characteristics
{
public class Resolver : IResolver
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/Code/ArrayParam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
using BenchmarkDotNet.Helpers;
using JetBrains.Annotations;

#nullable enable

namespace BenchmarkDotNet.Code
{
internal static class ArrayParam
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/Code/CodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
using BenchmarkDotNet.Running;
using RunMode = BenchmarkDotNet.Jobs.RunMode;

#nullable enable

namespace BenchmarkDotNet.Code
{
internal static class CodeGenerator
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/Code/DeclarationsProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
using BenchmarkDotNet.Extensions;
using BenchmarkDotNet.Running;

#nullable enable

namespace BenchmarkDotNet.Code
{
internal abstract class DeclarationsProvider
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/Columns/BaselineAllocationRatioColumn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
using BenchmarkDotNet.Reports;
using BenchmarkDotNet.Running;

#nullable enable

namespace BenchmarkDotNet.Columns
{
public class BaselineAllocationRatioColumn : BaselineCustomColumn
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/Columns/BaselineCustomColumn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
using BenchmarkDotNet.Running;
using JetBrains.Annotations;

#nullable enable

namespace BenchmarkDotNet.Columns
{
public abstract class BaselineCustomColumn : IColumn
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/Columns/BaselineRatioColumn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
using BenchmarkDotNet.Reports;
using BenchmarkDotNet.Running;

#nullable enable

namespace BenchmarkDotNet.Columns
{
public class BaselineRatioColumn : BaselineCustomColumn
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/Columns/LogicalGroupColumn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
using BenchmarkDotNet.Running;
using JetBrains.Annotations;

#nullable enable

namespace BenchmarkDotNet.Columns
{
public class LogicalGroupColumn : IColumn
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/Columns/MetricColumn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
using Perfolizer.Metrology;
using Pragmastat.Metrology;

#nullable enable

namespace BenchmarkDotNet.Columns
{
public class MetricColumn : IColumn
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/Columns/RankColumn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
using BenchmarkDotNet.Running;
using JetBrains.Annotations;

#nullable enable

namespace BenchmarkDotNet.Columns
{
public class RankColumn : IColumn
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/Columns/StatisticColumn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
using Perfolizer.Metrology;
using Pragmastat.Metrology;

#nullable enable

namespace BenchmarkDotNet.Columns
{
public interface IStatisticColumn : IColumn
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/Columns/TargetMethodColumn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
using BenchmarkDotNet.Reports;
using BenchmarkDotNet.Running;

#nullable enable

namespace BenchmarkDotNet.Columns
{
public class TargetMethodColumn : IColumn
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/Configs/DebugConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

using JetBrains.Annotations;

#nullable enable

namespace BenchmarkDotNet.Configs
{
/// <summary>
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/Configs/DefaultConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
using BenchmarkDotNet.Running;
using BenchmarkDotNet.Validators;

#nullable enable

namespace BenchmarkDotNet.Configs
{
public class DefaultConfig : IConfig
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/Configs/IConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
using BenchmarkDotNet.Running;
using BenchmarkDotNet.Validators;

#nullable enable

namespace BenchmarkDotNet.Configs
{
public interface IConfig
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/Configs/ImmutableConfigBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
using System.Collections.Immutable;
using System.Linq;

#nullable enable

namespace BenchmarkDotNet.Configs
{
/// <summary>
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/Configs/ManualConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
using BenchmarkDotNet.Validators;
using JetBrains.Annotations;

#nullable enable

namespace BenchmarkDotNet.Configs
{
public class ManualConfig : IConfig
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/ConsoleArguments/CommandLineOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
using JetBrains.Annotations;
using Perfolizer.Mathematics.OutlierDetection;

#nullable enable

namespace BenchmarkDotNet.ConsoleArguments
{
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
Expand Down
29 changes: 7 additions & 22 deletions src/BenchmarkDotNet/ConsoleArguments/ConfigParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
using BenchmarkDotNet.Toolchains.Mono;
using Perfolizer.Metrology;

#nullable enable

namespace BenchmarkDotNet.ConsoleArguments
{
public static class ConfigParser
Expand Down Expand Up @@ -553,8 +551,7 @@ private static Job CreateJobForGivenRuntime(Job baseJob, string runtimeId, Comma
runtimeId,
runtimeFrameworkVersion: "",
name: runtimeId,
options.CliPath?.FullName ?? "",
options.RestorePath?.FullName ?? "")));
options: options)));
}

case RuntimeMoniker.Mono:
Expand Down Expand Up @@ -677,8 +674,7 @@ private static Job MakeMonoJob(Job baseJob, CommandLineOptions options, MonoRunt
targetFrameworkMoniker: runtime.MsBuildMoniker,
runtimeFrameworkVersion: "",
name: runtime.Name,
customDotNetCliPath: options.CliPath?.FullName ?? "",
packagesPath: options.RestorePath?.FullName ?? "")));
options: options)));
}

private static Job MakeMonoAOTLLVMJob(Job baseJob, CommandLineOptions options, string msBuildMoniker, RuntimeMoniker moniker)
Expand All @@ -694,11 +690,7 @@ private static Job MakeMonoAOTLLVMJob(Job baseJob, CommandLineOptions options, s
targetFrameworkMoniker: monoAotLLVMRuntime.MsBuildMoniker,
runtimeFrameworkVersion: "",
name: monoAotLLVMRuntime.Name,
customDotNetCliPath: options.CliPath?.FullName ?? "",
packagesPath: options.RestorePath?.FullName ?? "",
customRuntimePack: options.CustomRuntimePack ?? "",
aotCompilerPath: options.AOTCompilerPath?.ToString() ?? "",
aotCompilerMode: options.AOTCompilerMode));
options: options));

return baseJob.WithRuntime(monoAotLLVMRuntime).WithToolchain(toolChain).WithId(monoAotLLVMRuntime.Name);
}
Expand All @@ -708,12 +700,9 @@ private static Job CreateR2RJob(Job baseJob, CommandLineOptions options, Runtime
var toolChain = R2RToolchain.From(
new NetCoreAppSettings(
targetFrameworkMoniker: runtime.MsBuildMoniker,
runtimeFrameworkVersion: null,
runtimeFrameworkVersion: "",
name: runtime.Name,
customDotNetCliPath: options.CliPath?.FullName,
packagesPath: options.RestorePath?.FullName,
customRuntimePack: options.CustomRuntimePack,
aotCompilerPath: options.AOTCompilerPath != null ? options.AOTCompilerPath.ToString() : null));
options: options));

return baseJob.WithRuntime(runtime).WithToolchain(toolChain).WithId(runtime.Name);
}
Expand All @@ -735,10 +724,7 @@ private static Job MakeWasmJob(Job baseJob, CommandLineOptions options, string m
targetFrameworkMoniker: wasmRuntime.MsBuildMoniker,
runtimeFrameworkVersion: "",
name: wasmRuntime.Name,
customDotNetCliPath: options.CliPath?.FullName ?? "",
packagesPath: options.RestorePath?.FullName ?? "",
customRuntimePack: options.CustomRuntimePack ?? "",
aotCompilerMode: options.AOTCompilerMode));
options: options));

return baseJob.WithRuntime(wasmRuntime).WithToolchain(toolChain).WithId(wasmRuntime.Name);
}
Expand Down Expand Up @@ -785,10 +771,9 @@ private static Job CreateCoreJobWithCli(Job baseJob, CommandLineOptions options)
.WithToolchain(CsProjCoreToolchain.From(
new NetCoreAppSettings(
targetFrameworkMoniker: RuntimeInformation.GetCurrentRuntime().MsBuildMoniker,
customDotNetCliPath: options.CliPath?.FullName ?? "",
runtimeFrameworkVersion: "",
name: RuntimeInformation.GetCurrentRuntime().Name,
packagesPath: options.RestorePath?.FullName ?? "")));
options: options)));

/// <summary>
/// we have a limited amount of space when printing the output to the console, so we try to keep things small and simple
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/ConsoleArguments/ListBenchmarks/Node.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System.Collections.Generic;

#nullable enable

namespace BenchmarkDotNet.ConsoleArguments.ListBenchmarks
{
internal class Node
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/ConsoleArguments/LoggerWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
using System.Text;
using BenchmarkDotNet.Loggers;

#nullable enable

namespace BenchmarkDotNet.ConsoleArguments
{
internal class LoggerWrapper : TextWriter
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/Detectors/Cpu/HardwareIntrinsics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
using System.Runtime.Intrinsics.Arm;
#endif

#nullable enable

namespace BenchmarkDotNet.Detectors.Cpu
{
// based on https://github.com/dotnet/runtime/tree/v10.0.0-rc.1.25451.107/src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt
Expand Down
2 changes: 0 additions & 2 deletions src/BenchmarkDotNet/Detectors/Cpu/Linux/LinuxCpuInfoParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

namespace BenchmarkDotNet.Detectors.Cpu.Linux;

#nullable enable

internal static class LinuxCpuInfoParser
{
private static class ProcCpu
Expand Down
Loading