2022-10-11 20:51:52 +02:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using BenchmarkDotNet.Running;
|
|
|
|
|
|
using Content.IntegrationTests;
|
|
|
|
|
|
using Content.Server.Maps;
|
2023-09-03 08:53:45 +12:00
|
|
|
|
#if DEBUG
|
|
|
|
|
|
using BenchmarkDotNet.Configs;
|
|
|
|
|
|
#else
|
2022-10-11 20:51:52 +02:00
|
|
|
|
using Robust.Benchmarks.Configs;
|
2023-09-03 08:53:45 +12:00
|
|
|
|
#endif
|
2022-10-11 20:51:52 +02:00
|
|
|
|
using Robust.Shared.Prototypes;
|
2019-06-02 01:17:07 +02:00
|
|
|
|
|
|
|
|
|
|
namespace Content.Benchmarks
|
|
|
|
|
|
{
|
2019-08-07 18:10:55 +02:00
|
|
|
|
internal static class Program
|
2019-06-02 01:17:07 +02:00
|
|
|
|
{
|
2022-10-11 20:51:52 +02:00
|
|
|
|
|
2019-06-02 01:17:07 +02:00
|
|
|
|
public static void Main(string[] args)
|
|
|
|
|
|
{
|
2022-10-11 20:51:52 +02:00
|
|
|
|
#if DEBUG
|
|
|
|
|
|
Console.ForegroundColor = ConsoleColor.Red;
|
|
|
|
|
|
Console.WriteLine("\nWARNING: YOU ARE RUNNING A DEBUG BUILD, USE A RELEASE BUILD FOR AN ACCURATE BENCHMARK");
|
|
|
|
|
|
Console.WriteLine("THE DEBUG BUILD IS ONLY GOOD FOR FIXING A CRASHING BENCHMARK\n");
|
|
|
|
|
|
BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, new DebugInProcessConfig());
|
|
|
|
|
|
#else
|
|
|
|
|
|
var config = Environment.GetEnvironmentVariable("ROBUST_BENCHMARKS_ENABLE_SQL") != null ? DefaultSQLConfig.Instance : null;
|
|
|
|
|
|
BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, config);
|
|
|
|
|
|
#endif
|
2019-06-02 01:17:07 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|