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
4 changes: 0 additions & 4 deletions src/BenchmarkDotNet/Code/CodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ internal static string Generate(BuildPartition buildPartition)
var benchmarksCode = new List<string>(buildPartition.Benchmarks.Length);

var extraDefines = new List<string>();
var additionalLogic = new HashSet<string>();

foreach (var buildInfo in buildPartition.Benchmarks)
{
Expand All @@ -38,8 +37,6 @@ internal static string Generate(BuildPartition buildPartition)

string passArguments = GetPassArguments(benchmark);

AddNonEmptyUnique(additionalLogic, benchmark.Descriptor.AdditionalLogic);

string benchmarkTypeCode = new SmartStringBuilder(ResourceHelper.LoadTemplate("BenchmarkType.txt"))
.Replace("$ID$", buildInfo.Id.ToString())
.Replace("$OperationsPerInvoke$", provider.OperationsPerInvoke)
Expand Down Expand Up @@ -77,7 +74,6 @@ internal static string Generate(BuildPartition buildPartition)
string benchmarkProgramContent = new SmartStringBuilder(ResourceHelper.LoadTemplate("BenchmarkProgram.txt"))
.Replace("$ShadowCopyDefines$", useShadowCopy ? "#define SHADOWCOPY" : null).Replace("$ShadowCopyFolderPath$", shadowCopyFolderPath)
.Replace("$ExtraDefines$", string.Join(Environment.NewLine, extraDefines))
.Replace("$AdditionalLogic$", string.Join(Environment.NewLine, additionalLogic))
.Replace("$DerivedTypes$", string.Join(Environment.NewLine, benchmarksCode))
.Replace("$ExtraAttribute$", GetExtraAttributes(buildPartition.RepresentativeBenchmarkCase.Descriptor))
.Replace("$NativeAotSwitch$", GetNativeAotSwitch(buildPartition))
Expand Down
4 changes: 0 additions & 4 deletions src/BenchmarkDotNet/Running/BenchmarkPartitioner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ public bool Equals(BenchmarkCase x, BenchmarkCase y)
if (x.Descriptor.Type.Assembly.Location != y.Descriptor.Type.Assembly.Location) // some toolchains produce the exe in the same folder as .dll (to get some scenarios like native dependencies work)
return false;

if (x.Descriptor.AdditionalLogic != y.Descriptor.AdditionalLogic) // it can be anything
return false;

if (x.Descriptor.WorkloadMethod.GetCustomAttributes(false).OfType<STAThreadAttribute>().Count() !=
y.Descriptor.WorkloadMethod.GetCustomAttributes(false).OfType<STAThreadAttribute>().Count()) // STA vs STA
return false;
Expand All @@ -65,7 +62,6 @@ public int GetHashCode(BenchmarkCase obj)
hashCode.Add(obj.GetToolchain());
hashCode.Add(obj.GetRuntime());
hashCode.Add(obj.Descriptor.Type.Assembly.Location);
hashCode.Add(obj.Descriptor.AdditionalLogic);
hashCode.Add(obj.Descriptor.WorkloadMethod.GetCustomAttributes(false).OfType<STAThreadAttribute>().Any());
var job = obj.Job;
hashCode.Add(job.Environment.Jit);
Expand Down
5 changes: 1 addition & 4 deletions src/BenchmarkDotNet/Running/Descriptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public class Descriptor : IEquatable<Descriptor>
public MethodInfo? GlobalCleanupMethod { get; }
public MethodInfo? IterationSetupMethod { get; }
public MethodInfo? IterationCleanupMethod { get; }
public string AdditionalLogic { get; }
public int OperationsPerInvoke { get; }
public string WorkloadMethodDisplayInfo { get; }
public int MethodIndex { get; }
Expand All @@ -36,7 +35,6 @@ public Descriptor(
MethodInfo? iterationSetupMethod = null,
MethodInfo? iterationCleanupMethod = null,
string? description = null,
string? additionalLogic = null,
bool baseline = false,
string[]? categories = null,
int operationsPerInvoke = 1,
Expand All @@ -52,10 +50,9 @@ public Descriptor(
IterationSetupMethod = iterationSetupMethod;
IterationCleanupMethod = iterationCleanupMethod;
OperationsPerInvoke = operationsPerInvoke;
AdditionalLogic = additionalLogic ?? string.Empty;
WorkloadMethodDisplayInfo = FormatDescription(description) ?? workloadMethod?.Name ?? "Untitled";
Baseline = baseline;
Categories = categories ?? Array.Empty<string>();
Categories = categories ?? [];
MethodIndex = methodIndex;
}

Expand Down
1 change: 0 additions & 1 deletion src/BenchmarkDotNet/Templates/BenchmarkProgram.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
$ShadowCopyDefines$
$ExtraDefines$
// <auto-generated />
$AdditionalLogic$
// this file must not be importing any namespaces
// we should use full names everywhere to avoid any potential naming conflicts, example: #1007, #778

Expand Down
10 changes: 0 additions & 10 deletions src/BenchmarkDotNet/Toolchains/InProcess/InProcessValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,6 @@ private InProcessValidator(bool failOnErrors)
/// <returns>Enumerable of validation errors.</returns>
public IEnumerable<ValidationError> Validate(ValidationParameters validationParameters)
{
foreach (var target in validationParameters.Benchmarks
.Where(benchmark => benchmark.Descriptor.AdditionalLogic.IsNotBlank())
.Select(b => b.Descriptor)
.Distinct())
{
yield return new ValidationError(
false,
$"Target {target} has {nameof(target.AdditionalLogic)} filled. AdditionalLogic is not supported by in-process toolchain.");
}

foreach (var benchmarkWithArguments in validationParameters.Benchmarks.Where(benchmark => benchmark.HasArguments && benchmark.GetToolchain() is InProcessNoEmitToolchain))
yield return new ValidationError(true, "Arguments are not supported by the InProcessNoEmitToolchain, see #687 for more details", benchmarkWithArguments);

Expand Down
Loading