mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2026-04-29 06:48:41 +00:00
Gvwie updated
This commit is contained in:
@@ -24,7 +24,7 @@ public static class IntArrayGenerator
|
||||
/// - minGap / maxGap: approximate gap between runs (large gaps produce the jump examples)
|
||||
/// </summary>
|
||||
///
|
||||
public static void InitRng() => rng = new Random(24241564);
|
||||
public static void InitRng(int seed= 24241564) => rng = new Random(seed);
|
||||
|
||||
public static long[] GenerateRuns(int length,
|
||||
int minRunSize = 3,
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Esiur.Tests.Gvwie
|
||||
const int TEST_ITERATIONS = 100;
|
||||
const int SAMPLE_SIZE = 100;
|
||||
|
||||
Console.WriteLine(";Esiur;FlatBuffer;ProtoBuffer,MessagePack;BSON;CBOR;Avro,Optimal");
|
||||
Console.WriteLine(";Esiur;Aligned;FlatBuffer;ProtoBuffer,MessagePack;BSON;CBOR;Avro,Optimal");
|
||||
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ namespace Esiur.Tests.Gvwie
|
||||
var file = $"run_chart_{gen.name}.csv";
|
||||
System.IO.File.WriteAllText(file, sb.ToString());
|
||||
var file2 = $"optimal_chart_{gen.name}.csv";
|
||||
System.IO.File.WriteAllText(file, sbr.ToString());
|
||||
System.IO.File.WriteAllText(file2, sbr.ToString());
|
||||
|
||||
Console.WriteLine($"Chart CSV written to: {file} {file2}");
|
||||
}
|
||||
|
||||
@@ -5,13 +5,27 @@ using MessagePack;
|
||||
|
||||
var e = GroupInt32Codec.Encode(new int[] {-12000, 15000, -1, 32760 });
|
||||
|
||||
var test = IntArrayGenerator.GenerateInt32(5000, GeneratorPattern.Uniform);
|
||||
|
||||
var aligned = GroupInt32Codec.Encode(test, true);
|
||||
var nonAligned = GroupInt32Codec.Encode(test, false);
|
||||
|
||||
var result1 = GroupInt32Codec.Decode(aligned);
|
||||
var result2 = GroupInt32Codec.Decode(nonAligned);
|
||||
|
||||
if (result1.SequenceEqual(result2))
|
||||
Console.WriteLine($"Passed {aligned.Length}");
|
||||
|
||||
if (result1.SequenceEqual(test))
|
||||
Console.WriteLine($"Passed {nonAligned.Length}");
|
||||
|
||||
MessagePack.MessagePackSerializer.DefaultOptions = MessagePackSerializerOptions.Standard
|
||||
.WithCompression(MessagePackCompression.None); // optional; remove if you want raw size
|
||||
|
||||
|
||||
var ints = new IntArrayRunner();
|
||||
IntArrayGenerator.InitRng();
|
||||
ints.Run();
|
||||
//IntArrayGenerator.InitRng();
|
||||
//ints.Run();
|
||||
IntArrayGenerator.InitRng();
|
||||
ints.RunChart();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user