BenchmarkDotNet
BenchmarkDotNet copied to clipboard
improve BaselineCustomAnalyzer warning message, fixes #2591
Went through #2591 and tried to improve the warning message here - taking a look at what code paths can cause this warning, I see that in BaseLineCustomColumn.ResultsAreInvalid it checks for whether the baseline / benchmark (or the results of) was null, and a check for !CanBeInverted on the baseline which checks if it's too close to zero.
internal static bool ResultsAreInvalid(Summary summary, BenchmarkCase benchmarkCase, BenchmarkCase? baseline)
{
return baseline == null ||
summary[baseline] == null ||
summary[baseline].ResultStatistics == null ||
!summary[baseline].ResultStatistics.CanBeInverted() ||
summary[benchmarkCase] == null ||
summary[benchmarkCase].ResultStatistics == null;
}
public bool CanBeInverted() => Min > 1e-9;
First issue here, let me know if this analysis is right / what other changes I need to make before this can be merged. Thanks! :)