コード例 #1
0
ファイル: Program.cs プロジェクト: OpenRIAServices/Benchmarks
        private static async Task RunPipelined()
        {
            var b = new E2Ebenchmarks();

            b.NumEntities  = 10;
            b.DomainClient = DomainClientType.WcfBinary;
            b.Start();

            await b.GetCititesReuseContext();

            Console.WriteLine("PRESS KEY TO START");
            Console.ReadLine();

            var sw = Stopwatch.StartNew();

            await b.PipelinedLoadAsync(5000, 20);

            Console.WriteLine("RunPipelined elapsed time is {0} for 2 ", sw.Elapsed);


            sw = Stopwatch.StartNew();

            await b.PipelinedLoadAsync(5000, 50);

            Console.WriteLine("RunPipelined elapsed time is {0} for 4 ", sw.Elapsed);

            sw = Stopwatch.StartNew();

            await b.PipelinedLoadAsync(5000, 100);

            Console.WriteLine("RunPipelined elapsed time is {0} for 4 ", sw.Elapsed);

            b.Stop();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: OpenRIAServices/Benchmarks
        private static void Main(string[] args)
        {
            if (args.Length > 0 && args.Contains("server"))
            {
                Uri uri = new Uri($"http://localhost/Temporary_Listen_Addresses/Cities/Services/Citites.svc");
                CityDomainService.GetCitiesResult = E2Ebenchmarks.CreateValidCities(1).ToList();
                StartServerAndWaitForKey(uri, typeof(ExampelService));
                StartServerAndWaitForKey(uri, typeof(CityDomainService));
                return;
            }

            if (onlyProfiling || (args.Length > 0 && args[0].Contains("profile")))
            {
                //Task.Run(() => RunBenchmarksAsyncParallel()).Wait();

                Task.Run(() => RunPipelined()).Wait();
                Console.WriteLine("PAUSE");
                Console.ReadLine();
                return;

                const int num = 1;
                for (int i = 0; i < 1; ++i)
                {
                    var a = new LoadBenchmarks();
                    a.NumEntities = num;
                    a.LoadEntities();
                    a.LoadAndRefreshEntities();
                    a.LoadAndMergeEntities();

                    var s = new ChangeSetBenchmarks();
                    s.NumEntities = num;
                    s.SubmitAdded();

                    var es = new EntitySetBenchmarks();
                    es.NumEntities = num;
                    es.Add();
                    es.AddAndDetach();
                    es.AddAndRemove();
                    es.Attach();
                    es.AttachAndDetach();
                    es.AttachAndModify();
                    es.AttachAndRemove();
                }
            }
            else
            {
                BenchmarkRunner.Run <LoadBenchmarks>();
                BenchmarkRunner.Run <E2Ebenchmarks>();
                //BenchmarkRunner.Run<EntityBenchmarks>();
                //BenchmarkRunner.Run<EntitySetBenchmarks>();
                //BenchmarkRunner.Run<ChangeSetBenchmarks>();
            }
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: OpenRIAServices/Benchmarks
        private static async Task RunBenchmarksAsyncParallel()
        {
            var b = new E2Ebenchmarks();

            b.DomainClient = DomainClientType.WcfBinary;
            b.Start();

            await b.GetCititesReuseContext();

            var sw = Stopwatch.StartNew();
            await b.RunBenchmarksAsyncParallel(100, 2);

            Console.WriteLine("RunBenchmarksAsyncParallel elapsed time is {0}", sw.Elapsed);
            b.Stop();
        }