/// <summary> /// Returns a report for the given benchmark or null if there is no a corresponded report. /// </summary> public BenchmarkReport this[BenchmarkCase benchmarkCase] => reportMap.GetValueOrDefault(benchmarkCase);
public string GetHighlightGroupKey(BenchmarkCase benchmarkCase) => null;
public bool IsDefault(Summary summary, BenchmarkCase benchmarkCase) => false;
private static bool ShouldUseLinuxDisassembler(BenchmarkCase benchmarkCase) => !(benchmarkCase.Job.Environment.Runtime is MonoRuntime) && RuntimeInformation.IsLinux();
public String GetValue(Summary summary, BenchmarkCase benchmarkCase, SummaryStyle style) { String unit = style.PrintUnitsInContent ? " MB/s" : ""; return(GetValue(summary, benchmarkCase) + unit); }
public string GetValue(Summary summary, BenchmarkCase benchmarkCase, ISummaryStyle style) => GetValue(summary, benchmarkCase);
public SynchronousProcessOutputLoggerWithDiagnoser(ILogger logger, Process process, IDiagnoser diagnoser, BenchmarkCase benchmarkCase, BenchmarkId benchmarkId, IConfig config) { if (!process.StartInfo.RedirectStandardOutput) { throw new NotSupportedException("set RedirectStandardOutput to true first"); } if (!process.StartInfo.RedirectStandardInput) { throw new NotSupportedException("set RedirectStandardInput to true first"); } this.logger = logger; this.process = process; this.diagnoser = diagnoser; diagnoserActionParameters = new DiagnoserActionParameters(process, benchmarkCase, benchmarkId, config); LinesWithResults = new List <string>(); LinesWithExtraOutput = new List <string>(); }
public string GetValue(Summary summary, BenchmarkCase benchmark) => GetValue(summary, benchmark, null);
public string GetValue(Summary summary, BenchmarkCase benchmarkCase) => summary.IsBaseline(benchmarkCase) ? "Yes" : "No";
public bool IsDefault(Summary summary, BenchmarkCase benchmark) => true;
public string GetValue(Summary summary, BenchmarkCase benchmark, ISummaryStyle style) { var property = typeof(ClassificationMetrics).GetProperty(_metricName); return(property.GetValue(StochasticDualCoordinateAscentClassifierBench.s_metrics).ToString()); }
} // we want to have only a single instance of MemoryDiagnoser public RunMode GetRunMode(BenchmarkCase benchmarkCase) => RunMode.NoOverhead;
public override bool IsSupported(BenchmarkCase benchmarkCase, ILogger logger, IResolver resolver) { return(CsProjCoreToolchain.NetCoreApp31.IsSupported(benchmarkCase, logger, resolver)); }
public string GetLogicalGroupKey(BenchmarkCase benchmarkCase) => orderer.GetLogicalGroupKey(Config, BenchmarksCases, benchmarkCase);
private static BenchmarkReport CreateReport(BenchmarkCase benchmarkCase, int n, double nanoseconds) { var buildResult = BuildResult.Success(GenerateResult.Success(ArtifactsPaths.Empty, Array.Empty <string>())); var executeResult = new ExecuteResult(true, 0, default, Array.Empty <string>(), new[] { $"// Runtime=extra output line" });
public IDiagnoser GetCompositeDiagnoser(BenchmarkCase benchmarkCase, RunMode runMode) { var diagnosersForGivenMode = diagnosers.Where(diagnoser => diagnoser.GetRunMode(benchmarkCase) == runMode).ToImmutableHashSet(); return(diagnosersForGivenMode.Any() ? new CompositeDiagnoser(diagnosersForGivenMode) : null); }
public string GetValue(Summary summary, BenchmarkCase benchmarkCase) { var type = benchmarkCase.Descriptor.WorkloadMethod.DeclaringType; return(type.GetCustomAttribute <DescriptionAttribute>()?.Description ?? type.Name.Replace("Benchmarks", string.Empty)); }
public string GetValue(Summary summary, BenchmarkCase benchmarkCase) { return(""); }
private static void Export(ILogger logger, BenchmarkCase benchmarkCase, Dictionary <HardwareCounter, (ulong withoutNoise, ulong total)> totals, IReadOnlyList <MethodWithCounters> model, HardwareCounter[] hardwareCounters)
public string GetValue(Summary summary, BenchmarkCase benchmark) => benchmark.Parameters.DisplayInfo;
private static bool ShouldUseMonoDisassembler(BenchmarkCase benchmarkCase) => benchmarkCase.Job.Environment.Runtime is MonoRuntime || RuntimeInformation.IsMono;
public static void RunCore(IHost host, BenchmarkCase benchmarkCase) { var target = benchmarkCase.Descriptor; var job = benchmarkCase.Job; // TODO: filter job (same as SourceCodePresenter does)? int unrollFactor = benchmarkCase.Job.ResolveValue(RunMode.UnrollFactorCharacteristic, EnvironmentResolver.Instance); // DONTTOUCH: these should be allocated together var instance = Activator.CreateInstance(benchmarkCase.Descriptor.Type); var workloadAction = BenchmarkActionFactory.CreateWorkload(target, instance, unrollFactor); var overheadAction = BenchmarkActionFactory.CreateOverhead(target, instance, unrollFactor); var globalSetupAction = BenchmarkActionFactory.CreateGlobalSetup(target, instance); var globalCleanupAction = BenchmarkActionFactory.CreateGlobalCleanup(target, instance); var iterationSetupAction = BenchmarkActionFactory.CreateIterationSetup(target, instance); var iterationCleanupAction = BenchmarkActionFactory.CreateIterationCleanup(target, instance); var dummy1 = BenchmarkActionFactory.CreateDummy(); var dummy2 = BenchmarkActionFactory.CreateDummy(); var dummy3 = BenchmarkActionFactory.CreateDummy(); FillMembers(instance, benchmarkCase); host.WriteLine(); foreach (string infoLine in BenchmarkEnvironmentInfo.GetCurrent().ToFormattedString()) { host.WriteLine("// {0}", infoLine); } host.WriteLine("// Job: {0}", job.DisplayInfo); host.WriteLine(); var engineParameters = new EngineParameters { Host = host, WorkloadActionNoUnroll = invocationCount => { for (int i = 0; i < invocationCount; i++) { workloadAction.InvokeSingle(); } }, WorkloadActionUnroll = workloadAction.InvokeMultiple, Dummy1Action = dummy1.InvokeSingle, Dummy2Action = dummy2.InvokeSingle, Dummy3Action = dummy3.InvokeSingle, OverheadActionNoUnroll = invocationCount => { for (int i = 0; i < invocationCount; i++) { overheadAction.InvokeSingle(); } }, OverheadActionUnroll = overheadAction.InvokeMultiple, GlobalSetupAction = globalSetupAction.InvokeSingle, GlobalCleanupAction = globalCleanupAction.InvokeSingle, IterationSetupAction = iterationSetupAction.InvokeSingle, IterationCleanupAction = iterationCleanupAction.InvokeSingle, TargetJob = job, OperationsPerInvoke = target.OperationsPerInvoke, MeasureExtraStats = benchmarkCase.Config.HasExtraStatsDiagnoser(), BenchmarkName = FullNameProvider.GetBenchmarkName(benchmarkCase) }; using (var engine = job .ResolveValue(InfrastructureMode.EngineFactoryCharacteristic, InfrastructureResolver.Instance) .CreateReadyToRun(engineParameters)) { var results = engine.Run(); host.ReportResults(results); // printing costs memory, do this after runs } }
public Boolean IsDefault(Summary summary, BenchmarkCase benchmarkCase) => false;
public string GetValue(Summary summary, BenchmarkCase benchmarkCase) { var type = benchmarkCase.Descriptor.WorkloadMethod.ReturnType; return(type == typeof(object) ? "dynamic" : type.Name); }
public string GetValue(Summary summary, BenchmarkCase benchmarkCase, SummaryStyle style) => Format(summary, benchmarkCase.Config, summary[benchmarkCase].ResultStatistics, style);
public RunMode GetRunMode(BenchmarkCase benchmarkCase) => throw new InvalidOperationException("Should never be called for Composite Diagnoser");
public string GetLogicalGroupKey(ImmutableArray <BenchmarkCase> allBenchmarksCases, BenchmarkCase benchmarkCase) => benchmarkCase.Descriptor.WorkloadMethodDisplayInfo;
private static BenchmarkReport CreateSimpleReport(BenchmarkCase benchmarkCase) => CreateReport(benchmarkCase, 1, 1);
public string GetValue(Summary summary, BenchmarkCase benchmarkCase) => getTag(benchmarkCase.Descriptor.WorkloadMethod.Name);
[PublicAPI] public bool HasReport(BenchmarkCase benchmarkCase) => reportMap.ContainsKey(benchmarkCase);