예제 #1
0
 private void btnSerializeProtoBuf_Click(object sender, EventArgs e)
 {
     benchmark("serialize ProtoBuf", sender, () =>
     {
         using (var stream = File.Create(@"c:\temp\hej3.$$$", 0x10000))
             Serializer.Serialize(stream, SerializeLargeValueObject.New());
         return(0);
     });
     fixGroupText1();
 }
예제 #2
0
 private void btnSerializeBinaryFormatter_Click(object sender, EventArgs e)
 {
     benchmark("serialize BinaryFormatter", sender, () =>
     {
         using (var stream = File.Create(@"c:\temp\hej2.$$$", 0x10000))
             new BinaryFormatter().Serialize(stream, SerializeLargeValueObject.New());
         return(0);
     });
     fixGroupText1();
 }
예제 #3
0
 private void btnSerializeJson_Click(object sender, EventArgs e)
 {
     benchmark("serialize Json", sender, () =>
     {
         using (var stream = File.Create(@"c:\temp\hej1.$$$", 0x10000))
             using (var tw = new StreamWriter(stream, Encoding.UTF8, 0x10000))
                 JsonSerializer.CreateDefault().Serialize(tw, SerializeLargeValueObject.New());
         return(0);
     });
     fixGroupText1();
 }
예제 #4
0
        private void btnSerializeSql_Click(object sender, EventArgs e)
        {
            SqlPersistence.CleanUp();

            benchmark("serialize SQL", sender, () =>
            {
                SqlPersistence.Save(SerializeLargeValueObject.New().Data);
                return(0);
            });
            fixGroupText1();
        }
예제 #5
0
        private void btnSerializeStructArray_Click(object sender, EventArgs e)
        {
            var thisData = new List <LargeValueObjectAsStruct[]> {
                SerializeLargeValueObject.New().Data
            };

            benchmark("serialize struct[]", sender, () =>
            {
                using (var stream = File.Create(@"c:\temp\hej4.$$$", 0x10000))
                    using (var bw = new BinaryWriter(stream))
                        LargeValueObjectHelper.SaveTestStructArrayListToStream(thisData, bw);
                return(0);
            });

            fixGroupText1();
        }