Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
ied206 committed Sep 1, 2023
2 parents 3907d8a + a130cfc commit 3493c55
Show file tree
Hide file tree
Showing 107 changed files with 2,641 additions and 65,877 deletions.
16 changes: 14 additions & 2 deletions Benchmark/BenchProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,21 @@ public static void NativeGlobalInit(AlgorithmFlags flags)
// zlib-ng and zlib are mutually exclusive.
// Joveler.Compression.ZLib cannot load two or more zlib at once.
if (flags.HasFlag(AlgorithmFlags.ZLibNg))
Joveler.Compression.ZLib.ZLibInit.GlobalInit(zlibNgCompatPath, false);
{
Joveler.Compression.ZLib.ZLibInitOptions initOpts = new Joveler.Compression.ZLib.ZLibInitOptions()
{
IsWindowsStdcall = false
};
Joveler.Compression.ZLib.ZLibInit.GlobalInit(zlibNgCompatPath, initOpts);
}
else if (flags.HasFlag(AlgorithmFlags.ZLibUp))
Joveler.Compression.ZLib.ZLibInit.GlobalInit(zlibUpstreamPath, true);
{
Joveler.Compression.ZLib.ZLibInitOptions initOpts = new Joveler.Compression.ZLib.ZLibInitOptions()
{
IsWindowsStdcall = true
};
Joveler.Compression.ZLib.ZLibInit.GlobalInit(zlibUpstreamPath, initOpts);
}

if (flags.HasFlag(AlgorithmFlags.XZ))
Joveler.Compression.XZ.XZInit.GlobalInit(xzPath);
Expand Down
3 changes: 0 additions & 3 deletions Benchmark/BenchSamples.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ public class BenchSamples
"bible_en_utf8.txt", // From Canterbury Corpus
"bible_kr_cp949.txt", // Public Domain (개역한글)
"bible_kr_utf8.txt", // Public Domain (개역한글)
"bible_kr_utf16le.txt", // Public Domain (개역한글)
"ooffice.dll", // From Silesia corpus
"reymont.pdf", // From Silesia corpus
"world192.txt", // From Canterbury corpus
};

public static List<string> LessFileNames { get; set; } = new List<string>()
Expand All @@ -23,7 +21,6 @@ public class BenchSamples
"bible_kr_utf8.txt", // Public Domain (개역한글)
"ooffice.dll", // From Silesia corpus
"reymont.pdf", // From Silesia corpus
"world192.txt", // From Canterbury corpus
};

public static List<string> Levels { get; set; } = new List<string>()
Expand Down
38 changes: 19 additions & 19 deletions Benchmark/BufferSizeBench.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,23 @@ public override bool LoadParams(object instance, BenchmarkCase benchmarkCase)
Descriptor descriptor = benchmarkCase.Descriptor;

// Get parameters from benchmarkCase
object bufferSizeVal = benchmarkCase.Parameters.Items.First(x => x.Name.Equals(bufferSizeKey, StringComparison.Ordinal)).Value;
object srcFileNameVal = benchmarkCase.Parameters.Items.First(x => x.Name.Equals(srcFileNameKey, StringComparison.Ordinal)).Value;
object modeVal = benchmarkCase.Parameters.Items.First(x => x.Name.Equals(modeKey, StringComparison.Ordinal)).Value;
if (bufferSizeVal is not string bufferSizeStr)
return false;
object bufferSizeVal = benchmarkCase.Parameters.Items.First(x => x.Name.Equals(bufferSizeKey, StringComparison.Ordinal)).Value;
if (srcFileNameVal is not string srcFileNameStr)
return false;
if (modeVal is not string modeStr)
return false;
if (bufferSizeVal is not int bufferSizeInt)
return false;

// Set parameters to benchmark instances
PropertyInfo bufferSizeProp = descriptor.Type.GetProperty(bufferSizeKey);
bufferSizeProp.SetValue(instance, bufferSizeStr);
PropertyInfo srcFileNameProp = descriptor.Type.GetProperty(srcFileNameKey);
srcFileNameProp.SetValue(instance, srcFileNameStr);
PropertyInfo modeProp = descriptor.Type.GetProperty(modeKey);
modeProp.SetValue(instance, modeStr);
PropertyInfo bufferSizeProp = descriptor.Type.GetProperty(bufferSizeKey);
bufferSizeProp.SetValue(instance, bufferSizeInt);
return true;
}

Expand All @@ -71,20 +71,6 @@ public class BufferSizeBench
private const string ModeCompress = "Compress";
private const string ModeDecompress = "Decompress";

// BufferSizes
[ParamsSource(nameof(BufferSizes))]
public int BufferSize { get; set; }
public IReadOnlyList<int> BufferSizes { get; set; } = new int[]
{
64 * 1024,
128 * 1024,
256 * 1024,
512 * 1024,
1024 * 1024,
2 * 1024 * 1024,
4 * 1024 * 1024,
};

// SrcFiles
[ParamsSource(nameof(SrcFileNames))]
public string SrcFileName { get; set; }
Expand All @@ -103,6 +89,20 @@ public class BufferSizeBench
ModeCompress,
ModeDecompress,
};

// BufferSizes
[ParamsSource(nameof(BufferSizes))]
public int BufferSize { get; set; }
public IReadOnlyList<int> BufferSizes { get; set; } = new int[]
{
64 * 1024,
128 * 1024,
256 * 1024,
512 * 1024,
1024 * 1024,
2 * 1024 * 1024,
4 * 1024 * 1024,
};
#endregion

#region Startup and Cleanup
Expand Down
Binary file removed Benchmark/Samples/Best/bible_kr_utf16le.txt.lz4
Binary file not shown.
Binary file removed Benchmark/Samples/Best/bible_kr_utf16le.txt.xz
Binary file not shown.
Binary file removed Benchmark/Samples/Best/bible_kr_utf16le.txt.zst
Binary file not shown.
Binary file removed Benchmark/Samples/Best/bible_kr_utf16le.txt.zz
Binary file not shown.
Binary file removed Benchmark/Samples/Best/world192.txt.lz4
Binary file not shown.
Binary file removed Benchmark/Samples/Best/world192.txt.xz
Binary file not shown.
Binary file removed Benchmark/Samples/Best/world192.txt.zst
Binary file not shown.
Binary file removed Benchmark/Samples/Best/world192.txt.zz
Binary file not shown.
Binary file removed Benchmark/Samples/Default/bible_kr_utf16le.txt.lz4
Binary file not shown.
Binary file removed Benchmark/Samples/Default/bible_kr_utf16le.txt.xz
Binary file not shown.
Binary file removed Benchmark/Samples/Default/bible_kr_utf16le.txt.zst
Binary file not shown.
Binary file removed Benchmark/Samples/Default/bible_kr_utf16le.txt.zz
Binary file not shown.
Binary file removed Benchmark/Samples/Default/world192.txt.lz4
Binary file not shown.
Binary file removed Benchmark/Samples/Default/world192.txt.xz
Binary file not shown.
Binary file removed Benchmark/Samples/Default/world192.txt.zst
Binary file not shown.
Binary file removed Benchmark/Samples/Default/world192.txt.zz
Binary file not shown.
Binary file removed Benchmark/Samples/Fastest/bible_kr_utf16le.txt.lz4
Binary file not shown.
Binary file removed Benchmark/Samples/Fastest/bible_kr_utf16le.txt.xz
Binary file not shown.
Binary file removed Benchmark/Samples/Fastest/bible_kr_utf16le.txt.zst
Binary file not shown.
Binary file removed Benchmark/Samples/Fastest/bible_kr_utf16le.txt.zz
Binary file not shown.
Binary file removed Benchmark/Samples/Fastest/world192.txt.lz4
Binary file not shown.
Binary file removed Benchmark/Samples/Fastest/world192.txt.xz
Binary file not shown.
Binary file removed Benchmark/Samples/Fastest/world192.txt.zst
Binary file not shown.
Binary file removed Benchmark/Samples/Fastest/world192.txt.zz
Binary file not shown.
Binary file removed Benchmark/Samples/Raw/bible_kr_utf16le.txt
Binary file not shown.
Loading

0 comments on commit 3493c55

Please sign in to comment.