コード例 #1
0
 private void btnLargeStructArray_Click(object sender, EventArgs e)
 {
     benchmark("Large instances in struct[]", sender, () =>
     {
         return(LargeValueObjectHelper.PlayWithStructList(5));
     });
 }
コード例 #2
0
 private void btnLargeClassArray_Click(object sender, EventArgs e)
 {
     benchmark("Large instances in class[]", sender, () =>
     {
         return(LargeValueObjectHelper.PlayWithClass(5));
     });
 }
コード例 #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();
 }
コード例 #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();
        }
コード例 #5
0
ファイル: LargeValueObject.cs プロジェクト: factor10/PerfPres
 public static SerializeLargeValueObject New(int size = 1000000)
 {
     return(new SerializeLargeValueObject {
         Data = LargeValueObjectHelper.PlayWithStruct(size)
     });
 }