Exemplo n.º 1
0
        public void BenchMarkTest()
        {
            BenchmarkData benchmarkData = new BenchmarkData();

            benchmarkData.SetupData();

            BenchmarkIt.Benchmark.This("loop", () =>
            {
                int[] loopWay = CreateByStandardWay(COUNT, FILL_VALUE);
            })
            .Against.This("linq", () =>
            {
                int[] linqWay = CreateByLinqWay(COUNT, FILL_VALUE);
            })
            .Against.This("memset_half", () =>
            {
                int[] memSetHalfWay = CreateByMemSetHalfWay(COUNT, FILL_VALUE);
            })
            .Against.This("memset_X2", () =>
            {
                int[] memSetX2Way = CreateByMemSetX2Way(COUNT, FILL_VALUE);
            })
            .For(100000)
            .Iterations()
            .PrintComparison();
        }
        public void PerformanceTestByBenchmarkIt()
        {
            BenchmarkData benchmarkData = new BenchmarkData();
            benchmarkData.SetupData();

            BenchmarkIt.Benchmark.This("ExactWay", () =>
            {
                double[] standardResult = benchmarkData.ExactWay();
            })
            .Against.This("FastWay", () =>
            {
                double[] fastResult = benchmarkData.FastWay();
            })
            .For(1000)
            .Iterations()
            .PrintComparison();
        }
Exemplo n.º 3
0
        public void PerformanceTestByBenchmarkIt()
        {
            BenchmarkData benchmarkData = new BenchmarkData();

            benchmarkData.SetupData();

            BenchmarkIt.Benchmark.This("ExactWay", () =>
            {
                double[] standardResult = benchmarkData.ExactWay();
            })
            .Against.This("FastWay", () =>
            {
                double[] fastResult = benchmarkData.FastWay();
            })
            .For(1000)
            .Iterations()
            .PrintComparison();
        }
Exemplo n.º 4
0
        public void BenchMarkTest()
        {
            BenchmarkData benchmarkData = new BenchmarkData();

            benchmarkData.SetupData();

            BenchmarkIt.Benchmark.This("TestGeneric1", () =>
            {
                bool r1 = TestGeneric1(10.0f);
            })
            .Against.This("TestGeneric2", () =>
            {
                bool r2 = TestGeneric2(10.0f);
            })
            .WithWarmup(10)
            .For(10000000)
            .Iterations()
            .PrintComparison();
        }