protected BenchmarkEnvironmentInfo() { Architecture = RuntimeInformation.GetArchitecture(); ClrVersion = RuntimeInformation.GetClrVersion(); Configuration = RuntimeInformation.GetConfiguration(); HasRyuJit = RuntimeInformation.HasRyuJit(); IsServerGC = GCSettings.IsServerGC; IsConcurrentGC = GCSettings.LatencyMode != GCLatencyMode.Batch; }
protected BenchmarkEnvironmentInfo() { Architecture = RuntimeInformation.GetArchitecture(); RuntimeVersion = RuntimeInformation.GetRuntimeVersion(); Configuration = RuntimeInformation.GetConfiguration(); HasRyuJit = RuntimeInformation.HasRyuJit(); JitInfo = RuntimeInformation.GetJitInfo(); IsServerGC = GCSettings.IsServerGC; IsConcurrentGC = GCSettings.LatencyMode != GCLatencyMode.Batch; HasAttachedDebugger = Debugger.IsAttached; }
protected BenchmarkEnvironmentInfo() { Architecture = RuntimeInformation.GetArchitecture(); RuntimeVersion = RuntimeInformation.GetRuntimeVersion(); Configuration = RuntimeInformation.GetConfiguration(); HasRyuJit = RuntimeInformation.HasRyuJit(); JitInfo = RuntimeInformation.GetJitInfo(); IsServerGC = GCSettings.IsServerGC; IsConcurrentGC = GCSettings.LatencyMode != GCLatencyMode.Batch; HasAttachedDebugger = Debugger.IsAttached; GCAllocationQuantum = GcStats.AllocationQuantum; InDocker = RuntimeInformation.IsRunningInContainer; }
private EnvironmentInfo() { BenchmarkDotNetCaption = GetBenchmarkDotNetCaption(); BenchmarkDotNetVersion = GetBenchmarkDotNetVersion(); OsVersion = RuntimeInformation.GetOsVersion(); ProcessorName = RuntimeInformation.GetProcessorName(); ProcessorCount = Environment.ProcessorCount; ClrVersion = RuntimeInformation.GetClrVersion(); Architecture = GetArchitecture(); HasAttachedDebugger = Debugger.IsAttached; HasRyuJit = RuntimeInformation.HasRyuJit(); Configuration = RuntimeInformation.GetConfiguration(); ChronometerFrequency = Chronometer.Frequency; JitModules = RuntimeInformation.GetJitModules(); HardwareTimerKind = Chronometer.HardwareTimerKind; DotNetCliVersion = new Lazy <string>(DotNetCliCommandExecutor.GetDotNetCliVersion); }
public void Benchmark() { if (Assembly.GetEntryAssembly().IsJitOptimizationDisabled().IsTrue()) { throw new InvalidOperationException("Auto-generated project has not enabled optimizations!"); } if (typeof(CustomBuildConfiguration).Assembly.IsJitOptimizationDisabled().IsTrue()) { throw new InvalidOperationException("Project that defines benchmarks has not enabled optimizations!"); } if (RuntimeInformation.GetConfiguration() == RuntimeInformation.DebugConfigurationName) { throw new InvalidOperationException($"Configuration rezognized as {RuntimeInformation.DebugConfigurationName}!"); } #if !CUSTOM throw new InvalidOperationException("Should never happen"); #endif }