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: 1 addition & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
OLD_REPORT: "${{ github.workspace }}/performanceResults/performance.EmptyModels-report.json"

- name: Run comparison tool for descriptions
run: dotnet run -c Release --project ./performance/resultsComparer/resultsComparer.csproj -- compare $OLD_REPORT $NEW_REPORT -p ZeroPointOnePercentDifferenceMemoryUsage
run: dotnet run -c Release --project ./performance/resultsComparer/resultsComparer.csproj -- compare $OLD_REPORT $NEW_REPORT -p ZeroPointTwoPercentDifferenceMemoryUsage
shell: bash
env:
NEW_REPORT: "${{ github.workspace }}/performance/benchmark/BenchmarkDotNet.Artifacts/results/performance.Descriptions-report.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public static IBenchmarkComparisonPolicy[] GetAllPolicies()
return [
IdenticalMemoryUsagePolicy.Instance,
ZeroPointOnePercentDifferenceMemoryUsagePolicy.Instance,
ZeroPointTwoPercentDifferenceMemoryUsagePolicy.Instance,
OnePercentDifferenceMemoryUsagePolicy.Instance,
TwoPercentDifferenceMemoryUsagePolicy.Instance,
FivePercentDifferenceMemoryUsagePolicy.Instance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
public ZeroPointOnePercentDifferenceMemoryUsagePolicy():base(0.1f) {}
}

internal sealed class ZeroPointTwoPercentDifferenceMemoryUsagePolicy : PercentageMemoryUsagePolicy
{
public static ZeroPointTwoPercentDifferenceMemoryUsagePolicy Instance { get; } = new ZeroPointTwoPercentDifferenceMemoryUsagePolicy();
protected override string TypeName => nameof(ZeroPointTwoPercentDifferenceMemoryUsagePolicy);
public ZeroPointTwoPercentDifferenceMemoryUsagePolicy():base(0.2f) {}
}

internal sealed class OnePercentDifferenceMemoryUsagePolicy : PercentageMemoryUsagePolicy
{
public static OnePercentDifferenceMemoryUsagePolicy Instance { get; } = new OnePercentDifferenceMemoryUsagePolicy();
Expand Down Expand Up @@ -44,7 +51,7 @@
return false;
}
var forwardRatio = GetPercentageDifference(x, y);
var backwardRatio = GetPercentageDifference(y, x);

Check warning on line 54 in performance/resultsComparer/policies/PercentageMemoryUsagePolicy.cs

View workflow job for this annotation

GitHub Actions / Build

Parameters to 'GetPercentageDifference' have the same names but not the same order as the method arguments. (https://rules.sonarsource.com/csharp/RSPEC-2234)
return forwardRatio <= TolerancePercentagePoints && backwardRatio <= TolerancePercentagePoints;
}
private static double GetPercentageDifference(BenchmarkMemory x, BenchmarkMemory y)
Expand Down
Loading