static void Main(string[] args) { var options = JitBenchHarnessOptions.Parse(args); s_temporaryDirectory = Path.Combine(options.IntermediateOutputDirectory, "JitBench"); s_targetArchitecture = options.TargetArchitecture; if (string.IsNullOrWhiteSpace(s_targetArchitecture)) { throw new ArgumentNullException("Unspecified target architecture."); } if (Directory.Exists(s_temporaryDirectory)) { Directory.Delete(s_temporaryDirectory, true); } Directory.CreateDirectory(s_temporaryDirectory); s_jitBenchDevDirectory = Path.Combine(s_temporaryDirectory, "JitBench-dev"); using (var h = new XunitPerformanceHarness(args)) { ProcessStartInfo startInfo = Setup(); h.RunScenario(startInfo, () => { PrintHeader("Running Benchmark Scenario"); }, PostIteration, PostProcessing, s_ScenarioConfiguration); } }
static void Main(string[] args) { var options = JitBenchHarnessOptions.Parse(args); s_temporaryDirectory = options.IntermediateOutputDirectory; s_targetArchitecture = options.TargetArchitecture; if (string.IsNullOrWhiteSpace(s_targetArchitecture)) { throw new ArgumentNullException("Unspecified target architecture."); } // J == JitBench folder. By reducing the length of the directory // name we attempt to reduce the chances of hitting PATH length // problems we have been hitting in the lab. // The changes we have done have reduced it in this way: // C:\Jenkins\workspace\perf_scenario---5b001a46\bin\sandbox\JitBench\JitBench-dev // C:\j\workspace\perf_scenario---5b001a46\bin\sandbox\JitBench\JitBench-dev // C:\j\w\perf_scenario---5b001a46\bin\sandbox\JitBench\JitBench-dev // C:\j\w\perf_scenario---5b001a46\bin\sandbox\J s_jitBenchDevDirectory = Path.Combine(s_temporaryDirectory, "J"); using (var h = new XunitPerformanceHarness(args)) { ProcessStartInfo startInfo = Setup(); h.RunScenario(startInfo, () => { PrintHeader("Running Benchmark Scenario"); }, PostIteration, PostProcessing, s_ScenarioConfiguration); } }
static void Main(string[] args) { var options = JitBenchHarnessOptions.Parse(args); SetupStatics(options); using (var h = new XunitPerformanceHarness(args)) { ProcessStartInfo startInfo = options.UseExistingSetup ? UseExistingSetup() : CreateNewSetup(); string scenarioName = "MusicStore"; if (options.EnableTiering) { startInfo.Environment.Add("COMPlus_EXPERIMENTAL_TieredCompilation", "1"); scenarioName += " Tiering"; } if (options.Minopts) { startInfo.Environment.Add("COMPlus_JITMinOpts", "1"); scenarioName += " Minopts"; } if (options.DisableR2R) { startInfo.Environment.Add("COMPlus_ReadyToRun", "0"); scenarioName += " NoR2R"; } if (options.DisableNgen) { startInfo.Environment.Add("COMPlus_ZapDisable", "1"); scenarioName += " NoNgen"; } var scenarioConfiguration = CreateScenarioConfiguration(); h.RunScenario(startInfo, () => { PrintHeader(scenarioName); }, PostIteration, PostProcessing, scenarioConfiguration); } }
static void Main(string[] args) { var options = JitBenchHarnessOptions.Parse(args); SetupStatics(options); using (var h = new XunitPerformanceHarness(args)) { ProcessStartInfo startInfo = options.UseExistingSetup ? UseExistingSetup() : CreateNewSetup(); string scenarioName = "MusicStore"; if (!startInfo.Environment.ContainsKey("DOTNET_MULTILEVEL_LOOKUP")) { throw new InvalidOperationException("DOTNET_MULTILEVEL_LOOKUP was not defined."); } if (startInfo.Environment["DOTNET_MULTILEVEL_LOOKUP"] != "0") { throw new InvalidOperationException("DOTNET_MULTILEVEL_LOOKUP was not set to 0."); } if (options.EnableTiering) { startInfo.Environment.Add("COMPlus_EXPERIMENTAL_TieredCompilation", "1"); scenarioName += " Tiering"; } if (options.Minopts) { startInfo.Environment.Add("COMPlus_JITMinOpts", "1"); scenarioName += " Minopts"; } if (options.DisableR2R) { startInfo.Environment.Add("COMPlus_ReadyToRun", "0"); scenarioName += " NoR2R"; } if (options.DisableNgen) { startInfo.Environment.Add("COMPlus_ZapDisable", "1"); scenarioName += " NoNgen"; } var program = new JitBenchHarness("JitBench"); try { var scenarioConfiguration = new ScenarioConfiguration(TimeSpan.FromMilliseconds(60000), startInfo) { Iterations = (int)options.Iterations, PreIterationDelegate = program.PreIteration, PostIterationDelegate = program.PostIteration, }; var processesOfInterest = new string[] { "dotnet.exe", }; var modulesOfInterest = new string[] { "Anonymously Hosted DynamicMethods Assembly", "clrjit.dll", "coreclr.dll", "dotnet.exe", "MusicStore.dll", "ntoskrnl.exe", "System.Private.CoreLib.dll", "Unknown", }; if (!File.Exists(startInfo.FileName)) { throw new FileNotFoundException(startInfo.FileName); } if (!Directory.Exists(startInfo.WorkingDirectory)) { throw new DirectoryNotFoundException(startInfo.WorkingDirectory); } h.RunScenario(scenarioConfiguration, teardownDelegate: () => { return(program.PostRun("MusicStore", processesOfInterest, modulesOfInterest)); }); } catch { Console.WriteLine(program.StandardOutput); Console.WriteLine(program.StandardError); throw; } } }