Move compression to folder.

This commit is contained in:
2021-09-28 01:41:24 +01:00
parent 2a2e67997a
commit 16e4ee76f4
5 changed files with 8 additions and 13 deletions

View File

@@ -1,4 +1,5 @@
using AaruBenchmark.Checksums; using AaruBenchmark.Checksums;
using AaruBenchmark.Compression;
using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Jobs;
@@ -8,23 +9,23 @@ namespace AaruBenchmark
public class GzipBenchs public class GzipBenchs
{ {
[Benchmark] [Benchmark]
public void SharpCompress() => AaruBenchmark.SharpCompress.Gzip(); public void SharpCompress() => Compression.SharpCompress.Gzip();
[Benchmark(Baseline = true)] [Benchmark(Baseline = true)]
public void DotNetRuntime() => NetRuntime.Gzip(); public void DotNetRuntime() => NetRuntime.Gzip();
[Benchmark] [Benchmark]
public void DotNetZip() => AaruBenchmark.DotNetZip.Gzip(); public void DotNetZip() => Compression.DotNetZip.Gzip();
} }
[SimpleJob(RuntimeMoniker.Net60)] [SimpleJob(RuntimeMoniker.Net60)]
public class Bzip2Benchs public class Bzip2Benchs
{ {
[Benchmark(Baseline = true)] [Benchmark(Baseline = true)]
public void SharpCompress() => AaruBenchmark.SharpCompress.Bzip2(); public void SharpCompress() => Compression.SharpCompress.Bzip2();
[Benchmark] [Benchmark]
public void DotNetZip() => AaruBenchmark.DotNetZip.Bzip2(); public void DotNetZip() => Compression.DotNetZip.Bzip2();
} }
[SimpleJob(RuntimeMoniker.Net60)] [SimpleJob(RuntimeMoniker.Net60)]

View File

@@ -68,7 +68,6 @@ namespace AaruBenchmark.Checksums
public static void Crc32() public static void Crc32()
{ {
byte[] data = new byte[1048576]; byte[] data = new byte[1048576];
uint s = 0;
byte[] hash = new byte[4]; byte[] hash = new byte[4];
var fs = new FileStream(Path.Combine(Program.Folder, "random"), FileMode.Open, FileAccess.Read); var fs = new FileStream(Path.Combine(Program.Folder, "random"), FileMode.Open, FileAccess.Read);
@@ -102,7 +101,6 @@ namespace AaruBenchmark.Checksums
public static void Md5() public static void Md5()
{ {
byte[] data = new byte[1048576]; byte[] data = new byte[1048576];
uint s = 0;
byte[] hash = new byte[16]; byte[] hash = new byte[16];
var fs = new FileStream(Path.Combine(Program.Folder, "random"), FileMode.Open, FileAccess.Read); var fs = new FileStream(Path.Combine(Program.Folder, "random"), FileMode.Open, FileAccess.Read);
@@ -136,7 +134,6 @@ namespace AaruBenchmark.Checksums
public static void Sha1() public static void Sha1()
{ {
byte[] data = new byte[1048576]; byte[] data = new byte[1048576];
uint s = 0;
byte[] hash = new byte[20]; byte[] hash = new byte[20];
var fs = new FileStream(Path.Combine(Program.Folder, "random"), FileMode.Open, FileAccess.Read); var fs = new FileStream(Path.Combine(Program.Folder, "random"), FileMode.Open, FileAccess.Read);
@@ -170,7 +167,6 @@ namespace AaruBenchmark.Checksums
public static void Sha256() public static void Sha256()
{ {
byte[] data = new byte[1048576]; byte[] data = new byte[1048576];
uint s = 0;
byte[] hash = new byte[32]; byte[] hash = new byte[32];
var fs = new FileStream(Path.Combine(Program.Folder, "random"), FileMode.Open, FileAccess.Read); var fs = new FileStream(Path.Combine(Program.Folder, "random"), FileMode.Open, FileAccess.Read);
@@ -204,7 +200,6 @@ namespace AaruBenchmark.Checksums
public static void Sha384() public static void Sha384()
{ {
byte[] data = new byte[1048576]; byte[] data = new byte[1048576];
uint s = 0;
byte[] hash = new byte[48]; byte[] hash = new byte[48];
var fs = new FileStream(Path.Combine(Program.Folder, "random"), FileMode.Open, FileAccess.Read); var fs = new FileStream(Path.Combine(Program.Folder, "random"), FileMode.Open, FileAccess.Read);
@@ -238,7 +233,6 @@ namespace AaruBenchmark.Checksums
public static void Sha512() public static void Sha512()
{ {
byte[] data = new byte[1048576]; byte[] data = new byte[1048576];
uint s = 0;
byte[] hash = new byte[64]; byte[] hash = new byte[64];
var fs = new FileStream(Path.Combine(Program.Folder, "random"), FileMode.Open, FileAccess.Read); var fs = new FileStream(Path.Combine(Program.Folder, "random"), FileMode.Open, FileAccess.Read);

View File

@@ -2,7 +2,7 @@ using System.IO;
using Ionic.BZip2; using Ionic.BZip2;
using Ionic.Zlib; using Ionic.Zlib;
namespace AaruBenchmark namespace AaruBenchmark.Compression
{ {
public static class DotNetZip public static class DotNetZip
{ {

View File

@@ -1,7 +1,7 @@
using System.IO; using System.IO;
using System.IO.Compression; using System.IO.Compression;
namespace AaruBenchmark namespace AaruBenchmark.Compression
{ {
public static class NetRuntime public static class NetRuntime
{ {

View File

@@ -3,7 +3,7 @@ using SharpCompress.Compressors;
using SharpCompress.Compressors.BZip2; using SharpCompress.Compressors.BZip2;
using SharpCompress.Compressors.Deflate; using SharpCompress.Compressors.Deflate;
namespace AaruBenchmark namespace AaruBenchmark.Compression
{ {
public static class SharpCompress public static class SharpCompress
{ {