static void Main(string[] args) { // Use reflection for a more maintainable way of creating the benchmark switcher, // Benchmarks are listed in namespace order first (e.g. BenchmarkDotNet.Samples.CPU, // BenchmarkDotNet.Samples.IL, etc) then by name, so the output is easy to understand var benchmarks = Assembly.GetExecutingAssembly().GetTypes() .Where(t => t.GetMethods(BindingFlags.Instance | BindingFlags.Public) .Any(m => m.GetCustomAttributes(typeof(BenchmarkAttribute), false).Any())) .OrderBy(t => t.Namespace) .ThenBy(t => t.Name) .ToArray(); var competitionSwitch = new BenchmarkSwitcher(benchmarks); competitionSwitch.Run(args); }
public static void Main(string[] args) { BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args); }
static void Main(string[] args) { BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, DefaultConfig.Instance); }
static void Main(string[] args) { // Without the line below, parameters with decimals will be outputted with commas in certain cultures Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args); }
private static void Main(string[] args) => BenchmarkSwitcher.FromAssembly(typeof(Program).GetTypeInfo().Assembly).Run(args);
static void Main(string[] args) => BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, new StandardConfig());
static void Main() { BenchmarkSwitcher.FromTypes(Assembly.GetExecutingAssembly().GetTypes() .Where(t => t.IsSubclassOfRawGeneric(typeof(BenchmarkBase <>))).ToArray()).RunAllJoined(); Console.ReadKey(); }
static void Main(string[] args) => BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, new CustomConfig().Config);
// the args must contain: // an information that we want to run benchmark as Wasm: // --runtimes Wasm // path to dotnet cli // --cli /home/adam/projects/runtime/dotnet.sh // path to main js: // --wasmMainJs /home/adam/projects/runtime/src/mono/wasm/runtime-test.js public static void Run(string[] args) => BenchmarkSwitcher.FromAssembly(typeof(IntroWasmCmdConfig).Assembly).Run(args);
static void Main(string[] args) { BenchmarkSwitcher.FromAssembly(typeof(Program).GetTypeInfo().Assembly).Run(args); Console.Read(); }
public static void Main(string[] args) { BenchmarkSwitcher switcher = new BenchmarkSwitcher(typeof(Program).Assembly); switcher.Run(args); }
static void Main(string[] args) => BenchmarkSwitcher.FromAssembly(typeof(Run).Assembly).Run(args);
static void Main(string[] args) { SimdInfo.PrintSimdInfo(Console.Out); BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args); }
public static void Main(string[] arguments) => BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(arguments, DefaultConfiguration);
public static void Main(string[] args) { BenchmarkSwitcher.FromAssembly(typeof(StringIsNullOrEmptyBenchmark).Assembly).Run(args); }
static int Main(string[] args) => BenchmarkSwitcher .FromAssembly(typeof(Program).Assembly) .Run(args, GetConfig()) .ToExitCode();
public static void Main(string[] args) { const string dataDirVar = "BENCODEX_BENCHMARKS_DATA_DIR"; const string simpleModeVar = "BENCODEX_BENCHMARKS_SIMPLE"; const string decodeOnlyVar = "BENCODEX_BENCHMARKS_DECODE_ONLY"; const int simpleModeSample = 50; bool ToBool(string?v) => new[] { "1", "t", "true", "y", "yes", "on" }.Contains(v?.ToLowerInvariant()); string dirPath = Environment.GetEnvironmentVariable(dataDirVar) ?? "."; Console.Error.WriteLine("Look up Bencodex benchmark data files in {0}...", dirPath); Console.Error.WriteLine("(You can configure the directory to look up by setting {0}.)", dataDirVar); bool simpleMode = ToBool(Environment.GetEnvironmentVariable(simpleModeVar)); bool decodeOnly = false; if (simpleMode) { Console.Error.WriteLine( "Run benchmarks on the simple mode, which samples only the heaviest {0} files" + "and also does not use BenchmarkDotNet...", simpleModeSample ); Console.Error.WriteLine("You can profile the benchmarks on the simple mode."); decodeOnly = ToBool(Environment.GetEnvironmentVariable(decodeOnlyVar)); if (decodeOnly) { Console.Error.WriteLine("Benchmark only decoding..."); } else { Console.Error.WriteLine( "If you want to benchmark only decoding, configure {0}=true.", decodeOnlyVar ); } } else { Console.Error.WriteLine("Run benchmarks using BenchmarkDotNet..."); Console.Error.WriteLine( "There is the simple mode too, which can be turned on by setting {0}=true.", simpleModeVar ); } FileInfo[] files; if (Directory.Exists(dirPath)) { files = Directory.EnumerateFiles(dirPath, "*.dat", SearchOption.AllDirectories) .Select(p => new FileInfo(p)) .ToArray(); } else { files = new[] { new FileInfo(dirPath) }; } if (simpleMode) { files = files.OrderByDescending(f => f.Length).Take(simpleModeSample).ToArray(); } int count = 0; long size = 0; foreach (FileInfo file in files) { size += file.Length; Console.Error.WriteLine("{0}", file); count++; } ByteSize byteSize = ByteSize.FromBytes(size); Console.Error.WriteLine( "Loading {0} files ({1} = {2} bytes)...", count, byteSize, size); if (simpleMode) { SimpleMode(files, decodeOnly); } else { DataFiles = files.Select(f => f.FullName).ToArray(); BenchmarkSwitcher.FromAssembly(typeof(CodecBenchmark).Assembly).Run(args); } }
public static void Main(string[] args) { BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args); //, new DebugInProcessConfig()); }
public static void Main(string[] args) => BenchmarkSwitcher .FromAssembly(typeof(Program).Assembly) .Run(args, CreateCustomConfig());
static void Main(string[] args) { BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args); // ProgrammRunner.Run(new ComplexOperationTestProgram()); // ProgrammRunner.Run(new EdgePreservingSmoothingProgram()); }
static void Main(string[] args) { InitArrays(); BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args); }
static void Main(string[] args) { //if (args.Length == 0) //{ // // var b1 = new FetchGraphBenchmark(); // // var b2 = new FetchIndividualBenchmark(); // // var b3 = new FetchSetBenchmark(); // // var b4 = new InsertSetBenchmark(); // // var b5 = new SelectBenchmark(); // // var b6 = new UpdateBenchmark(); // // var b7 = new QueryGenerationBenchmark(); // var b8 = new Issue3253Benchmark(); // // b1.Setup(); // // b2.Setup(); // // b3.Setup(); // // b4.Setup(); // // b5.Setup(); // // b6.Setup(); // // b7.Setup(); // b8.Setup(); // for (var i = 0; i < 10; i++) // { // // b1.Compiled(); // // b1.Linq(); // // b2.Compiled(); // // b2.Linq(); // // b3.Compiled(); // // b3.Linq(); // // b4.Test(); // // b5.Compiled(); // // b5.Execute(); // // b5.FromSql_Formattable(); // // b5.FromSql_Interpolation(); // // b5.Linq(); // // b5.Query(); // // b6.CompiledLinqObject(); // // b6.CompiledLinqSet(); // // b6.LinqObject(); // // b6.LinqSet(); // // b6.Object(); // // b7.VwSalesByCategoryContains(); // // b7.VwSalesByYear(); // // b7.VwSalesByYearMutation(); // b8.Small_UpdateStatement_With_Variable_Parameters(); // //b8.Small_UpdateStatement_With_Variable_Parameters_Async(); // b8.Small_UpdateStatement_With_Static_Parameters(); // //b8.Small_UpdateStatement_With_Static_Parameters_Async(); // b8.Large_UpdateStatement_With_Variable_Parameters(); // //b8.Large_UpdateStatement_With_Variable_Parameters_Async(); // b8.Large_UpdateStatement_With_Static_Parameters(); // //b8.Large_UpdateStatement_With_Static_Parameters_Async(); // b8.Large_UpdateStatement_With_Variable_Parameters_With_ClearCaches(); // //b8.Large_UpdateStatement_With_Variable_Parameters_With_ClearCaches_Async(); // b8.Small_InsertStatement_With_Variable_Parameters(); // //b8.Small_InsertStatement_With_Variable_Parameters_Async(); // b8.Small_InsertStatement_With_Static_Parameters(); // //b8.Small_InsertStatement_With_Static_Parameters_Async(); // b8.Large_InsertStatement_With_Variable_Parameters(); // //b8.Large_InsertStatement_With_Variable_Parameters_Async(); // b8.Large_InsertStatement_With_Static_Parameters(); // //b8.Large_InsertStatement_With_Static_Parameters_Async(); // b8.Large_InsertStatement_With_Variable_Parameters_With_ClearCaches(); // //b8.Large_InsertStatement_With_Variable_Parameters_With_ClearCaches_Async(); // b8.Large_Compiled_InsertStatement_With_Variable_Parameters(); // b8.Large_InsertStatement_With_Variable_Parameters_Using_Expression_Overload(); // //b8.Large_InsertStatement_With_Variable_Parameters_Using_Expression_Overload_Async(); // } // return; //} //TestConcurrent(); /* * VwSalesByCategoryContainsPerf(); * return; */ BenchmarkSwitcher .FromAssembly(typeof(Program).Assembly) .Run( args.Length > 0 ? args : new[] { "--filter=*" }, Config.Instance); }
static void Main(string[] args) { BenchmarkSwitcher .FromAssembly(typeof(Common.CommonTest).Assembly) .Run(new string[] { "--job", "short", "--runtimes", "netcoreapp31", "--filter", "*" }, new AllowNonOptimized()); }
/// <summary> /// execute dotnet run -c Release and choose the benchmarks you want to run /// </summary> /// <param name="args"></param> public static void Main(string[] args) => BenchmarkSwitcher .FromAssemblyAndTypes(typeof(Program).Assembly, GetGenericBenchmarks()) .Run(args /*, CreateClrVsCoreConfig() uncomment it to run Clr vs .NET Core comparison*/);
static void Main(string[] args) { BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, new DebugInProcessConfig()); Console.ReadKey(); }
static void Main(string[] args) { BenchmarkSwitcher.FromAssembly(Assembly.GetExecutingAssembly()).Run(args); }
public static void Main(string[] args) { BenchmarkSwitcher .FromAssembly(typeof(Program).Assembly) .Run(args, DefaultConfig.Instance.WithOption(ConfigOptions.DisableOptimizationsValidator, true)); }
public static void Main(string[] args) { BenchmarkSwitcher.FromAssembly(typeof(ShapeFactoryBenchmark).Assembly).Run(args); }
private static void Main(string[] args) => _ = BenchmarkSwitcher .FromAssembly(typeof(InsightBenchmark).Assembly) .Run(args, new Config());
static void Main(String[] args) => BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args);
static void Main(string[] args) { BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args); //BenchmarkRunner.Run<HashAlgorithmBenchmark>(); }