fix: Removes profiling. Streamlines core tick count. (#1948)

### 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.
This commit is contained in:
Kamron Batman 2024-09-11 00:55:18 -07:00 committed by GitHub
parent 65bc264402
commit 2e6ddcd31a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 80 additions and 949 deletions

View file

@ -15,7 +15,6 @@
using Server.Accounting;
using Server.Collections;
using Server.Diagnostics;
using Server.HuePickers;
using Server.Items;
using Server.Logging;
@ -455,14 +454,6 @@ public partial class NetState : IComparable<NetState>, IValueLinkListNode<NetSta
try
{
PacketSendProfile prof = null;
if (Core.Profiling)
{
prof = PacketSendProfile.Acquire(span[0]);
prof.Start();
}
if (_packetEncoder != null)
{
length = _packetEncoder(span, buffer);
@ -484,8 +475,6 @@ public partial class NetState : IComparable<NetState>, IValueLinkListNode<NetSta
_flushPending.Enqueue(this);
_flushQueued = true;
}
prof?.Finish();
}
catch (Exception ex)
{
@ -804,14 +793,6 @@ public partial class NetState : IComparable<NetState>, IValueLinkListNode<NetSta
SetPacketTime(packetId);
}
PacketReceiveProfile prof = null;
if (Core.Profiling)
{
prof = PacketReceiveProfile.Acquire(packetId);
prof?.Start();
}
UpdatePacketCount(packetId);
if (PacketLogging)
@ -826,8 +807,6 @@ public partial class NetState : IComparable<NetState>, IValueLinkListNode<NetSta
handler.OnReceive(this, new SpanReader(packetReader.Buffer.Slice(start, remainingLength)));
prof?.Finish(packetLength);
return ParserState.AwaitingNextPacket;
}