mmanela / diffplex

DiffPlex is Netstandard 1.0+ C# library to generate textual diffs.
Apache License 2.0
1.01k stars 184 forks source link

Use BenchmarkDotNet instead of the custom PerfTester #65

Closed WojciechNagorski closed 4 years ago

WojciechNagorski commented 4 years ago

In this PR I used BenchmarkDotNet instead of custom PerfTest. Thanks to it we have:

Results BenchmarkDotNet=v0.12.1, OS=Windows 10.0.18362.1082 (1903/May2019Update/19H1) Intel Core i7-8565U CPU 1.80GHz (Whiskey Lake), 1 CPU, 8 logical and 4 physical cores .NET Core SDK=5.0.100-rc.1.20452.10 [Host] : .NET Core 3.1.2 (CoreCLR 4.700.20.6602, CoreFX 4.700.20.6702), X64 RyuJIT DefaultJob : .NET Core 3.1.2 (CoreCLR 4.700.20.6602, CoreFX 4.700.20.6702), X64 RyuJIT

Method Mean Error StdDev Gen 0 Gen 1 Gen 2 Allocated
BuildDiffModel 32.23 ms 0.569 ms 0.505 ms 1031.2500 437.5000 156.2500 6.24 MB

Limitations I didn't want to change the behavior of the benchmark so it still generates different examples during runtime. It is not a good pattern.

How to run

cd Perf.DiffPlex
dotnet run -c Release -- --filter *