2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2026-04-29 06:48:41 +00:00
This commit is contained in:
2026-04-12 13:31:49 +03:00
parent ae524f577a
commit fefe76c726
2 changed files with 14 additions and 21 deletions
+2 -6
View File
@@ -32,8 +32,7 @@ namespace Esiur.Tests.Gvwie
const int TEST_ITERATIONS = 100;
const int SAMPLE_SIZE = 100;
Console.WriteLine(";Esiur;Aligned;FlatBuffer;ProtoBuffer,MessagePack;BSON;CBOR;Avro,Optimal");
Console.WriteLine(",Esiur,Aligned,FlatBuffer,ProtoBuffer,MessagePack,BSON,CBOR,Avro,Optimal");
Console.Write("Cluster (Int32);");
@@ -57,11 +56,8 @@ namespace Esiur.Tests.Gvwie
PrintAverage(
Average(() => CompareInt(IntArrayGenerator.GenerateInt32(SAMPLE_SIZE, GeneratorPattern.Small)), TEST_ITERATIONS)
);
// CompareInt(int32small);
Console.Write("Alternating (Int32);");
//CompareInt(int32alter);
PrintAverage(
Average(() => CompareInt(IntArrayGenerator.GenerateInt32(SAMPLE_SIZE, GeneratorPattern.Alternating)), TEST_ITERATIONS)
);
@@ -423,7 +419,7 @@ namespace Esiur.Tests.Gvwie
sum.Average(x => x.Item9)
};
Console.WriteLine($"{rt[0]};{rt[1]};{rt[2]};{rt[3]};{rt[4]};{rt[5]};{rt[6]};{rt[7]};{rt[8]}");
Console.WriteLine($"{rt[0]},{rt[1]},{rt[2]},{rt[3]},{rt[4]},{rt[5]},{rt[6]},{rt[7]},{rt[8]}");
return rt;
+12 -15
View File
@@ -3,29 +3,26 @@ using Esiur.Data.Gvwie;
using Esiur.Tests.Gvwie;
using MessagePack;
var e = GroupInt32Codec.Encode(new int[] {-12000, 15000, -1, 32760 });
//var e = GroupInt32Codec.Encode(new int[] {-12000, 15000, -1, 32760 });
var s = new int[] { 1, -1, 2, 300, 301, 200,1, 302 };
var e = GroupInt32Codec.Encode(s);
var d = GroupInt32Codec.Decode(e);
if (d.SequenceEqual(s))
Console.WriteLine("Example passed.");
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();