From 2099bae7491966f0d516cb06867e402f6e853d9b Mon Sep 17 00:00:00 2001 From: "Pranav Senthilnathan (from Dev Box)" Date: Wed, 30 Oct 2024 11:36:21 -0700 Subject: [PATCH] change BytesAllocatedPerOperation to long? --- src/tools/ResultsComparer/DataTransferContracts.cs | 2 +- src/tools/ResultsComparer/MultipleInputsComparer.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/ResultsComparer/DataTransferContracts.cs b/src/tools/ResultsComparer/DataTransferContracts.cs index 5136e0e7fcb..a66f824497f 100644 --- a/src/tools/ResultsComparer/DataTransferContracts.cs +++ b/src/tools/ResultsComparer/DataTransferContracts.cs @@ -88,7 +88,7 @@ public class Memory public int Gen1Collections { get; set; } public int Gen2Collections { get; set; } public long TotalOperations { get; set; } - public long BytesAllocatedPerOperation { get; set; } + public long? BytesAllocatedPerOperation { get; set; } } public class Measurement diff --git a/src/tools/ResultsComparer/MultipleInputsComparer.cs b/src/tools/ResultsComparer/MultipleInputsComparer.cs index dfef22395fb..986a879e2b8 100644 --- a/src/tools/ResultsComparer/MultipleInputsComparer.cs +++ b/src/tools/ResultsComparer/MultipleInputsComparer.cs @@ -103,10 +103,10 @@ private static string GetRatio((string id, Benchmark baseResult, Benchmark diffR private static string GetAllocatedDiff(Benchmark diffResult, Benchmark baseResult) { - long baseline = baseResult.Memory.BytesAllocatedPerOperation; + long baseline = baseResult.Memory.BytesAllocatedPerOperation ?? 0; if (baseline == 0) baseline = GetMetricValue(baseResult); - long diff = diffResult.Memory.BytesAllocatedPerOperation; + long diff = diffResult.Memory.BytesAllocatedPerOperation ?? 0; if (diff == 0) diff = GetMetricValue(diffResult);