static void Main() { var stopWatch = new Stopwatch(); stopWatch.Start(); var memoryMap = new MemoryMap <BigDataParent>("SomeKey"); var sampleBigData = memoryMap.Load(); Console.WriteLine( $"memoryMap.Load elapsed time: {stopWatch.Elapsed}"); Console.WriteLine( $"Loaded '{sampleBigData.Description}'"); Console.WriteLine( $"Total SomeDouble: {sampleBigData.BigDataChildren.Sum(x => x.SomeDouble)}"); Console.ReadKey(); }
static void Main() { var sampleBigDataIn = CreateBigDataParent(10000); Console.WriteLine( $"Created '{sampleBigDataIn.Description}'"); Console.WriteLine( $"with a total SomeDouble: {sampleBigDataIn.BigDataChildren.Sum(x => x.SomeDouble)}"); var stopWatch = new Stopwatch(); stopWatch.Start(); var memoryMap = new MemoryMap <BigDataParent>("SomeKey"); memoryMap.Create(sampleBigDataIn); Console.WriteLine( $"memoryMap.Create elapsed time: {stopWatch.Elapsed}"); var sampleBigDataOut = memoryMap.Load(); Console.WriteLine( $"Create and Load elapsed time: {stopWatch.Elapsed}"); stopWatch.Stop(); var childId = sampleBigDataIn.BigDataChildren[0].Id; Console.WriteLine($"BigDataParent comparison check for childId: {childId}"); var totalSomeDoubleIn = sampleBigDataIn.BigDataChildren .Where(x => x.Id.Equals(childId)).Sum(x => x.SomeDouble); Console.WriteLine($"totalSomeDoubleIn : {totalSomeDoubleIn}"); var totalSomeDoubleOut = sampleBigDataOut.BigDataChildren .Where(x => x.Id.Equals(childId)).Sum(x => x.SomeDouble); Console.WriteLine($"totalSomeDoubleOut: {totalSomeDoubleOut}"); Console.ReadKey(); }