コード例 #1
0
ファイル: Program.cs プロジェクト: neofuji/MessagePack-CSharp
        public MapDeserializeBenchmark()
        {
            target = new SerializerTarget
            {
                MyProperty1 = 1,
                MyProperty2 = 2,
                MyProperty3 = 3,
                MyProperty4 = 4,
                MyProperty5 = 5,
                MyProperty6 = 6,
                MyProperty7 = 7,
                // MyProperty8 = 8,
                MyProperty9 = 9,
            };

            context = new MsgPack.Serialization.SerializationContext
            {
                SerializationMethod = MsgPack.Serialization.SerializationMethod.Map
            };

            byteA = context.GetSerializer <SerializerTarget>().PackSingleObject(target);
            byteB = oldmsgpack::MessagePack.MessagePackSerializer.Serialize(target);
            byteC = newmsgpack::MessagePack.MessagePackSerializer.Serialize(target);
            byteD = farmhashmsgpack::MessagePack.MessagePackSerializer.Serialize(target);
            byteE = farm2msgpack::MessagePack.MessagePackSerializer.Serialize(target);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: yjpark/MessagePack-CSharp
 public SerializeBenchmark()
 {
     target = new SerializerTarget
     {
         MyProperty1 = 1,
         MyProperty2 = 2,
         MyProperty3 = 3,
         MyProperty4 = 4,
         MyProperty5 = 5,
         MyProperty6 = 6,
         MyProperty7 = 7,
         MyProperty8 = 8,
         MyProperty9 = 9,
     };
 }