Add SpawnEquipDeleteBenchmark (#19566)

This commit is contained in:
Leon Friedrich
2023-09-03 08:53:45 +12:00
committed by GitHub
parent 946958f6c6
commit 182b5267ad
5 changed files with 80 additions and 4 deletions

View File

@@ -1,11 +1,14 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Running;
using Content.IntegrationTests;
using Content.Server.Maps;
#if DEBUG
using BenchmarkDotNet.Configs;
#else
using Robust.Benchmarks.Configs;
#endif
using Robust.Shared.Prototypes;
namespace Content.Benchmarks
@@ -25,6 +28,7 @@ namespace Content.Benchmarks
var gameMaps = pair.Server.ResolveDependency<IPrototypeManager>().EnumeratePrototypes<GameMapPrototype>().ToList();
MapLoadBenchmark.MapsSource = gameMaps.Select(x => x.ID);
await pair.CleanReturnAsync();
PoolManager.Shutdown();
#if DEBUG
Console.ForegroundColor = ConsoleColor.Red;
@@ -35,8 +39,6 @@ namespace Content.Benchmarks
var config = Environment.GetEnvironmentVariable("ROBUST_BENCHMARKS_ENABLE_SQL") != null ? DefaultSQLConfig.Instance : null;
BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, config);
#endif
PoolManager.Shutdown();
}
}
}