Esempio n. 1
0
        //[Fact]
        public void Repeat_Performance()
        {
            TimeSpan time = time = LinqPerformanceCore.Measure <int>(1, 1000, LinqPerformanceCore.WrapperType.NoWrap,
                                                                     col => Enumerable.Repeat(0, 1000000));

            LinqPerformanceCore.WriteLine("Repeat_Performance: {0}ms", time.TotalMilliseconds);
        }
Esempio n. 2
0
        private void RunTestGroup(string description, Func <IEnumerable <int>, IEnumerable <int> > linqApply)
        {
            TimeSpan time = TimeSpan.Zero;

            time = LinqPerformanceCore.Measure <int>(1000000, 100, LinqPerformanceCore.WrapperType.NoWrap, linqApply);
            LinqPerformanceCore.WriteLine(description + "_OnRawArray_Performance: {0}ms", time.TotalMilliseconds);

            time = LinqPerformanceCore.Measure <int>(1000000, 100, LinqPerformanceCore.WrapperType.IEnumerable, linqApply);
            LinqPerformanceCore.WriteLine(description + "_OnEnumerable_Performance: {0}ms", time.TotalMilliseconds);

            time = LinqPerformanceCore.Measure <int>(1000000, 100, LinqPerformanceCore.WrapperType.IReadOnlyCollection, linqApply);
            LinqPerformanceCore.WriteLine(description + "_OnReadOnlyCollection_Performance: {0}ms", time.TotalMilliseconds);

            time = LinqPerformanceCore.Measure <int>(1000000, 100, LinqPerformanceCore.WrapperType.ICollection, linqApply);
            LinqPerformanceCore.WriteLine(description + "_OnCollection_Performance: {0}ms", time.TotalMilliseconds);
        }