Example #1
0
        public async Task SequentialBulkWrites()
        {
            await GeneratePerfRangesForBlock(async (cache, size) => {
                var toWrite = PerfHelper.GenerateRandomDatabaseContents(size);

                var st = new Stopwatch();
                st.Start();

                await cache.Insert(toWrite);

                st.Stop();
                return(st.ElapsedMilliseconds);
            });
        }
Example #2
0
        public async Task ParallelSimpleWrites()
        {
            await GeneratePerfRangesForBlock(async (cache, size) => {
                var toWrite = PerfHelper.GenerateRandomDatabaseContents(size);

                var st = new Stopwatch();
                st.Start();

                await toWrite.ToObservable(BlobCache.TaskpoolScheduler)
                .Select(x => Observable.Defer(() => cache.Insert(x.Key, x.Value)))
                .Merge(32)
                .ToArray();

                st.Stop();
                return(st.ElapsedMilliseconds);
            });
        }
Example #3
0
        public async Task SequentialSimpleWrites()
        {
            await GeneratePerfRangesForBlock(async (cache, size) => {
                var toWrite = PerfHelper.GenerateRandomDatabaseContents(size);

                var st = new Stopwatch();
                st.Start();

                foreach (var kvp in toWrite)
                {
                    await cache.Insert(kvp.Key, kvp.Value);
                }

                st.Stop();
                return(st.ElapsedMilliseconds);
            });
        }