private static void RunRegisteredBenchers()
        {
            Console.WriteLine("\nStarting benchmarks.");
            Console.WriteLine("====================================================================");

            foreach (var bencher in RegisteredBenchers)
            {
                OriginalController.DisplayBencherInfo(bencher);
                try
                {
                    OriginalController.RunBencher(bencher);
                }
                catch (Exception ex)
                {
                    BencherUtils.DisplayException(ex);
                }
            }

            Console.WriteLine("\nPerforming memory measurement runs.");
            Console.WriteLine("====================================================================");
            AppDomain.MonitoringIsEnabled = true;
            foreach (var bencher in RegisteredBenchers)
            {
                OriginalController.DisplayBencherInfo(bencher);
                try
                {
                    OriginalController.RunMemoryAnalysisForBencher(bencher);
                }
                catch (Exception ex)
                {
                    BencherUtils.DisplayException(ex);
                }
            }
        }
Exemplo n.º 2
0
        private static void WarmupDB()
        {
            IBencher dbWarmer = new DataTableBencher()
            {
                CommandText = SqlSelectCommandText, ConnectionStringToUse = ConnectionString
            };

            Console.WriteLine("\nWarming up DB, DB client code and CLR");
            Console.WriteLine("====================================================================");
            OriginalController.DisplayBencherInfo(dbWarmer);
            for (int i = 0; i < LoopAmount; i++)
            {
                var result = dbWarmer.PerformSetBenchmark();
                OriginalController.ReportSetResult(result);
            }
        }
Exemplo n.º 3
0
        private static void RunRegisteredBenchers()
        {
            Console.WriteLine("\nStarting benchmarks.");
            Console.WriteLine("====================================================================");

            foreach (var bencher in RegisteredBenchers)
            {
                OriginalController.DisplayBencherInfo(bencher);
                try
                {
                    OriginalController.RunBencher(bencher);
                }
                catch (Exception ex)
                {
                    BencherUtils.DisplayException(ex);
                }
            }
        }
Exemplo n.º 4
0
        private static void DisplayHeader()
        {
            bool releaseBuild = true;

#if DEBUG
            releaseBuild = false;
#endif
            var    conBuilder       = new SqlConnectionStringBuilder(ConnectionString);
            string sqlServerVersion = "Unknown";
            using (var conForHeader = new SqlConnection(ConnectionString))
            {
                conForHeader.Open();
                sqlServerVersion = conForHeader.ServerVersion;
                conForHeader.Close();
            }


            Console.WriteLine("+-------------------------------------------------------------------------------------------");
            Console.WriteLine("| Raw Data Access / ORM Benchmarks.");
            Console.WriteLine(@"| Code available at              : https://github.com/FransBouma/RawDataAccessBencher");
            Console.WriteLine("| Benchmarks run on              : {0}", DateTime.Now.ToString("F"));
            Console.WriteLine("| Registered benchmarks          :");
            foreach (var bencher in RegisteredBenchers)
            {
                OriginalController.DisplayBencherInfo(bencher, "| \t", suffixWithDashLine: false);
            }
            Console.WriteLine("| Run set benchmarks             : {0}", PerformSetBenchmarks);
            Console.WriteLine("| Run individual fetch benchmarks: {0}", PerformIndividualBenchMarks);
            Console.WriteLine("| Number of set fetches          : {0}", LoopAmount);
            Console.WriteLine("| Number of individual keys      : {0}", IndividualKeysAmount);
            Console.WriteLine("| Release build                  : {0}", releaseBuild);
            Console.WriteLine("| Client OS                      : {0} ({1}bit)", Environment.OSVersion, Environment.Is64BitOperatingSystem ? "64" : "32");
            Console.WriteLine("| Bencher runs as 64bit          : {0}", Environment.Is64BitProcess);
            Console.WriteLine("| CLR version                    : {0}", Environment.Version);
            Console.WriteLine("| Number of CPUs                 : {0}", Environment.ProcessorCount);
            Console.WriteLine("| Server used                    : {0}", conBuilder.DataSource);
            Console.WriteLine("| Catalog used                   : {0}", conBuilder.InitialCatalog);
            Console.WriteLine("| SQL Server version used        : {0}", sqlServerVersion);
            Console.WriteLine("+-------------------------------------------------------------------------------------------\n");
        }
Exemplo n.º 5
0
 private static void DisplayBencherInfo(IBencher bencher)
 {
     OriginalController.DisplayBencherInfo(bencher, "\n", suffixWithDashLine: true);
 }