forked from space-wizards/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,349 changed files
with
24,606 additions
and
9,410 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"omnisharp.analyzeOpenDocumentsOnly": true | ||
"omnisharp.analyzeOpenDocumentsOnly": true, | ||
"dotnet.defaultSolution": "SpaceStation14.sln" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
using System.Threading.Tasks; | ||
using BenchmarkDotNet.Attributes; | ||
using Content.IntegrationTests; | ||
using Content.IntegrationTests.Pair; | ||
using Content.Server.Station.Systems; | ||
using Content.Shared.Roles; | ||
using Robust.Shared; | ||
using Robust.Shared.Analyzers; | ||
using Robust.Shared.GameObjects; | ||
using Robust.Shared.Map; | ||
|
||
namespace Content.Benchmarks; | ||
|
||
/// <summary> | ||
/// This benchmarks spawns several humans, gives them captain equipment and then deletes them. | ||
/// This measures performance for spawning, deletion, containers, and inventory code. | ||
/// </summary> | ||
[Virtual, MemoryDiagnoser] | ||
public class SpawnEquipDeleteBenchmark | ||
{ | ||
private TestPair _pair = default!; | ||
private StationSpawningSystem _spawnSys = default!; | ||
private const string Mob = "MobHuman"; | ||
private StartingGearPrototype _gear = default!; | ||
private EntityUid _entity; | ||
private EntityCoordinates _coords; | ||
|
||
[Params(1, 4, 16, 64)] | ||
public int N; | ||
|
||
[GlobalSetup] | ||
public async Task SetupAsync() | ||
{ | ||
ProgramShared.PathOffset = "../../../../"; | ||
PoolManager.Startup(null); | ||
_pair = await PoolManager.GetServerClient(); | ||
var server = _pair.Server; | ||
|
||
var mapData = await _pair.CreateTestMap(); | ||
_coords = mapData.GridCoords; | ||
_spawnSys = server.System<StationSpawningSystem>(); | ||
_gear = server.ProtoMan.Index<StartingGearPrototype>("CaptainGear"); | ||
} | ||
|
||
[GlobalCleanup] | ||
public async Task Cleanup() | ||
{ | ||
await _pair.DisposeAsync(); | ||
PoolManager.Shutdown(); | ||
} | ||
|
||
[Benchmark] | ||
public async Task SpawnDeletePlayer() | ||
{ | ||
await _pair.Server.WaitPost(() => | ||
{ | ||
var server = _pair.Server; | ||
for (var i = 0; i < N; i++) | ||
{ | ||
_entity = server.EntMan.SpawnAttachedTo(Mob, _coords); | ||
_spawnSys.EquipStartingGear(_entity, _gear, null); | ||
server.EntMan.DeleteEntity(_entity); | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.