-
Notifications
You must be signed in to change notification settings - Fork 514
/
Copy pathProgram.cs
84 lines (79 loc) · 3.17 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Environments;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Reports;
using BenchmarkDotNet.Running;
using System.Linq;
using BenchmarkDotNet.Toolchains.InProcess.NoEmit;
using BenchmarkDotNet.Columns;
using Nethermind.Evm.Benchmark;
using Nethermind.Precompiles.Benchmark;
namespace Nethermind.Benchmark.Runner
{
public class DashboardConfig : ManualConfig
{
public DashboardConfig(params Job[] jobs)
{
foreach (Job job in jobs)
{
AddJob(job.WithToolchain(InProcessNoEmitToolchain.Instance));
}
AddColumnProvider(DefaultColumnProviders.Descriptor);
AddColumnProvider(DefaultColumnProviders.Statistics);
AddColumnProvider(DefaultColumnProviders.Params);
AddColumnProvider(DefaultColumnProviders.Metrics);
AddLogger(BenchmarkDotNet.Loggers.ConsoleLogger.Default);
AddExporter(BenchmarkDotNet.Exporters.Json.JsonExporter.FullCompressed);
AddDiagnoser(BenchmarkDotNet.Diagnosers.MemoryDiagnoser.Default);
WithSummaryStyle(SummaryStyle.Default.WithMaxParameterColumnWidth(100));
}
}
public class PrecompileBenchmarkConfig : DashboardConfig
{
public PrecompileBenchmarkConfig() : base(Job.MediumRun.WithRuntime(CoreRuntime.Core90))
{
AddColumnProvider(new GasColumnProvider());
}
}
public static class Program
{
public static void Main(string[] args)
{
BenchmarkRunner.Run(typeof(StorageValueBenchmarks));
// List<Assembly> additionalJobAssemblies = [
// typeof(JsonRpc.Benchmark.EthModuleBenchmarks).Assembly,
// typeof(Benchmarks.Core.Keccak256Benchmarks).Assembly,
// typeof(Evm.Benchmark.EvmStackBenchmarks).Assembly,
// typeof(Network.Benchmarks.DiscoveryBenchmarks).Assembly,
// ];
//
// List<Assembly> simpleJobAssemblies = [
// // typeof(EthereumTests.Benchmark.EthereumTests).Assembly,
// ];
//
// if (Debugger.IsAttached)
// {
// BenchmarkSwitcher.FromAssemblies(additionalJobAssemblies.Union(simpleJobAssemblies).ToArray()).RunAll(new DebugInProcessConfig());
// }
// else
// {
// foreach (Assembly assembly in additionalJobAssemblies)
// {
// BenchmarkRunner.Run(assembly, new DashboardConfig(Job.MediumRun.WithRuntime(CoreRuntime.Core90)), args);
// }
//
// foreach (Assembly assembly in simpleJobAssemblies)
// {
// BenchmarkRunner.Run(assembly, new DashboardConfig(), args);
// }
//
// BenchmarkRunner.Run(typeof(KeccakBenchmark).Assembly, new PrecompileBenchmarkConfig(), args);
// }
}
}
}