Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            var types = typeof(Program)
                        .Assembly
                        .GetExportedTypes()
                        .Where(r => r != typeof(Program) && r.IsPublic)
                        .OrderBy(r => r.Name);

            var job    = Job.Default;
            var config = new ManualConfig();

            config.AddLogger(DefaultConfig.Instance.GetLoggers().ToArray());
            config.AddExporter(DefaultConfig.Instance.GetExporters().ToArray());
            config.AddColumnProvider(DefaultConfig.Instance.GetColumnProviders().ToArray());
            config.AddValidator(JitOptimizationsValidator.DontFailOnError);
            //config.AddJob(job.WithRuntime(ClrRuntime.Net461));
            //config.AddJob(job.WithRuntime(CoreRuntime.Core21));
            //config.AddJob(job.WithRuntime(CoreRuntime.Core31));
            config.AddJob(job.WithRuntime(CoreRuntime.Core50));
            config.AddDiagnoser(MemoryDiagnoser.Default);
            config.AddColumn(StatisticColumn.OperationsPerSecond);
            config.AddColumn(RankColumn.Arabic);

            var switcher = new BenchmarkSwitcher(types.ToArray());

            switcher.Run(args, config);
        }
        public static void AddDefaultColumns(ManualConfig config)
        {
            config.AddColumn(FixedColumn.VersionColumn);
            config.AddColumn(FixedColumn.OperatingSystemColumn);
            config.AddColumn(FixedColumn.DateTimeColumn);
            config.AddColumn(new EnvironmentVariableColumn("SystemTag", "SYSTEM_TAG"));

            config.AddExporter(MarkdownExporter.GitHub);
            config.AddExporter(new CsvExporter(CsvSeparator.Comma, ConfigHelper.CsvStyle));
        }
Exemplo n.º 3
0
        public static void Main(string[] args)
        {
            var config = new ManualConfig();

            config.AddExporter(DefaultConfig.Instance.GetExporters().ToArray());
            config.AddLogger(DefaultConfig.Instance.GetLoggers().ToArray());
            config.AddColumnProvider(DefaultConfig.Instance.GetColumnProviders().ToArray());
            config.AddColumn(new ThroughputColumn("MBps"));

            BenchmarkRunner.Run <MurMur3Benchmark>(config);
        }