adoconnection / SevenZipExtractor

C# wrapper for 7z.dll
MIT License
306 stars 83 forks source link

Use BenchmarkDotNet #39

Closed WojciechNagorski closed 4 years ago

WojciechNagorski commented 4 years ago

In this PR I used BenchmarkDotNet. There is the results:

Method Runtime Mean Error StdDev Gen 0 Gen 1 Gen 2 Allocated
PrintEntries .NET 4.7 1.554 ms 2.3155 ms 0.1269 ms 3.9063 - - 12.19 KB
ExtractFirstEntry .NET 4.7 6.741 ms 6.1841 ms 0.3390 ms 39.0625 39.0625 39.0625 189.3 KB
ExtractLastEntry .NET 4.7 9.653 ms 9.3084 ms 0.5102 ms 31.2500 31.2500 31.2500 183.08 KB
ExtractAll .NET 4.7 13.676 ms 3.1519 ms 0.1728 ms 62.5000 31.2500 31.2500 278.2 KB
PrintEntries .NET Core 3.1 1.594 ms 0.3715 ms 0.0204 ms 1.9531 - - 9.66 KB
ExtractFirstEntry .NET Core 3.1 7.571 ms 3.2880 ms 0.1802 ms 39.0625 39.0625 39.0625 186.88 KB
ExtractLastEntry .NET Core 3.1 10.529 ms 11.9141 ms 0.6531 ms 31.2500 31.2500 31.2500 180.7 KB
ExtractAll .NET Core 3.1 15.102 ms 12.7431 ms 0.6985 ms 62.5000 31.2500 31.2500 276.85 KB

You can run this benchmarks using the following commands:

λ  cd C:\Work\SevenZipExtractor\Benchmark

λ  dotnet run -c Release -f netcoreapp3.1 -- --filter *

You can print the list of available benchmark, using:

λ  dotnet run -c Release -f netcoreapp3.1 -- --list tree
Benchmark
 └─Benchmarks
    ├─PrintEntries
    ├─ExtractFirstEntry
    ├─ExtractLastEntry
    └─ExtractAll

You can find the BenchmarkDotNet documentation here: https://benchmarkdotnet.org/index.html

adoconnection commented 4 years ago

Great!

WojciechNagorski commented 4 years ago

@adoconnection Do you have a twitter account?

adoconnection commented 4 years ago

yes, im not a fan of twitter :) https://twitter.com/ADOConnection