Пример #1
0
        private static BenchmarkReport Run(Benchmark benchmark, ILogger logger, IConfig config)
        {
            var toolchain = Toolchain.GetToolchain(benchmark.Job.Runtime);

            logger.WriteLineHeader("// **************************");
            logger.WriteLineHeader("// Benchmark: " + benchmark.ShortInfo);

            var generateResult = Generate(logger, toolchain, benchmark);

            if (!generateResult.IsGenerateSuccess)
            {
                return(new BenchmarkReport(benchmark, generateResult, null, null, null));
            }

            var buildResult = Build(logger, toolchain, generateResult, benchmark);

            if (!buildResult.IsBuildSuccess)
            {
                return(new BenchmarkReport(benchmark, generateResult, buildResult, null, null));
            }

            var executeResults = Execute(logger, benchmark, toolchain, buildResult, config);

            var runs = new List <Measurement>();

            for (int index = 0; index < executeResults.Count; index++)
            {
                var executeResult = executeResults[index];
                runs.AddRange(executeResult.Data.Select(line => Measurement.Parse(logger, line, index + 1)).Where(r => r != null));
            }

            return(new BenchmarkReport(benchmark, generateResult, buildResult, executeResults, runs));
        }
Пример #2
0
 private static Benchmark[] GetSupportedBenchmarks(IList <Benchmark> benchmarks, CompositeLogger logger)
 {
     return(benchmarks.Where(benchmark => Toolchain.GetToolchain(benchmark.Job).IsSupported(benchmark, logger)).ToArray());
 }
Пример #3
0
 public void Benchmark()
 {
     Console.WriteLine($"{AvoidParsingException} {Toolchain.GetToolchain(Runtime.Host)}");
 }
Пример #4
0
 public void B()
 {
     Console.WriteLine($"{Toolchain.GetToolchain(Runtime.Host)}");
 }