Skip to content

Commit

Permalink
fix: Removes profiling. Streamlines core tick count. (#1948)
Browse files Browse the repository at this point in the history
### Summary
- Removes `Profiling` - Recommend using Visual Studio Performance Profiler,  [dotnet-trace](https://learn.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-trace) or [JetBrains dotTrace](https://www.jetbrains.com/profiler/)
- Cleans up the core tick count, sampling, etc.
  • Loading branch information
kamronbatman committed Sep 11, 2024
1 parent 65bc264 commit 2e6ddcd
Show file tree
Hide file tree
Showing 14 changed files with 76 additions and 945 deletions.
12 changes: 1 addition & 11 deletions Projects/Application/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@ public class Application
{
public static void Main(string[] args)
{
bool profiling = false;

foreach (var a in args)
{
if (a.InsensitiveEquals("-profile"))
{
profiling = true;
}
}

Core.Setup(profiling, Assembly.GetEntryAssembly(), Process.GetCurrentProcess());
Core.Setup(Assembly.GetEntryAssembly(), Process.GetCurrentProcess());
}
}
13 changes: 0 additions & 13 deletions Projects/Server.Tests/Helpers/Packet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Buffers;
using System.Diagnostics;
using System.IO;
using Server.Diagnostics;

namespace Server.Network

Check notice on line 6 in Projects/Server.Tests/Helpers/Packet.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Namespace does not correspond to file location

Namespace does not correspond to file location, must be: 'Server.Tests.Helpers'
{
Expand All @@ -19,12 +18,6 @@ public abstract class Packet
protected Packet(int packetID)
{
PacketID = packetID;

if (Core.Profiling)
{
var prof = PacketSendProfile.Acquire(PacketID);
prof.Increment();
}
}

protected Packet(int packetID, int length)
Expand All @@ -34,12 +27,6 @@ protected Packet(int packetID, int length)

Stream = PacketWriter.CreateInstance(length); // new PacketWriter( length );
Stream.Write((byte)packetID);

if (Core.Profiling)
{
var prof = PacketSendProfile.Acquire(PacketID);
prof.Increment();
}
}

public int PacketID { get; }
Expand Down
79 changes: 0 additions & 79 deletions Projects/Server/Diagnostics/BaseProfile.cs

This file was deleted.

88 changes: 0 additions & 88 deletions Projects/Server/Diagnostics/PacketProfile.cs

This file was deleted.

31 changes: 0 additions & 31 deletions Projects/Server/Diagnostics/TargetProfile.cs

This file was deleted.

44 changes: 0 additions & 44 deletions Projects/Server/Diagnostics/TimerProfile.cs

This file was deleted.

Loading

0 comments on commit 2e6ddcd

Please sign in to comment.