Ejemplo n.º 1
0
 private void btnLargeStructArray_Click(object sender, EventArgs e)
 {
     benchmark("Large instances in struct[]", sender, () =>
     {
         return(LargeValueObjectHelper.PlayWithStructList(5));
     });
 }
Ejemplo n.º 2
0
 private void btnLargeClassArray_Click(object sender, EventArgs e)
 {
     benchmark("Large instances in class[]", sender, () =>
     {
         return(LargeValueObjectHelper.PlayWithClass(5));
     });
 }
Ejemplo n.º 3
0
 private void btnDeserializeStructArray_Click(object sender, EventArgs e)
 {
     benchmark("deserialize struct[]", sender, () =>
     {
         var data = new List <LargeValueObjectAsStruct[]>();
         using (var stream = new FileStream(@"c:\temp\hej4.$$$", FileMode.Open, FileAccess.Read, FileShare.Read, 0x10000))
             using (var br = new BinaryReader(stream))
                 LargeValueObjectHelper.LoadTestStructArrayListFromStream(data, br);
         return(data);
     });
     fixGroupText2();
 }
Ejemplo n.º 4
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();
        }
Ejemplo n.º 5
0
 public static SerializeLargeValueObject New(int size = 1000000)
 {
     return(new SerializeLargeValueObject {
         Data = LargeValueObjectHelper.PlayWithStruct(size)
     });
 }