* C# compiler is not smart enough to understand ClientLoop is under very heavy usage and inline DebugPacket, so DebugPacket is run as a method, causing Packet

to be constantly pushed and popped uselessly, if you are not debugging packets. This showed some really big difference in a mock test, let's see how it behaves here.
0.6.6-post-fixes
Arthur Valadares 2009-06-29 19:24:30 +00:00
parent 7bb070be55
commit 4f6efa0249
1 changed files with 26 additions and 27 deletions

View File

@ -809,33 +809,30 @@ namespace OpenSim.Region.ClientStack.LindenUDP
protected void DebugPacket(string direction, Packet packet)
{
if (m_debugPacketLevel > 0)
string info;
if (m_debugPacketLevel < 255 && packet.Type == PacketType.AgentUpdate)
return;
if (m_debugPacketLevel < 254 && packet.Type == PacketType.ViewerEffect)
return;
if (m_debugPacketLevel < 253 && (
packet.Type == PacketType.CompletePingCheck ||
packet.Type == PacketType.StartPingCheck
))
return;
if (m_debugPacketLevel < 252 && packet.Type == PacketType.PacketAck)
return;
if (m_debugPacketLevel > 1)
{
string info;
if (m_debugPacketLevel < 255 && packet.Type == PacketType.AgentUpdate)
return;
if (m_debugPacketLevel < 254 && packet.Type == PacketType.ViewerEffect)
return;
if (m_debugPacketLevel < 253 && (
packet.Type == PacketType.CompletePingCheck ||
packet.Type == PacketType.StartPingCheck
))
return;
if (m_debugPacketLevel < 252 && packet.Type == PacketType.PacketAck)
return;
if (m_debugPacketLevel > 1)
{
info = packet.ToString();
}
else
{
info = packet.Type.ToString();
}
Console.WriteLine(m_circuitCode + ":" + direction + ": " + info);
info = packet.ToString();
}
else
{
info = packet.Type.ToString();
}
Console.WriteLine(m_circuitCode + ":" + direction + ": " + info);
}
/// <summary>
@ -853,12 +850,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (nextPacket.Incoming)
{
DebugPacket("IN", nextPacket.Packet);
if (m_debugPacketLevel > 0)
DebugPacket("IN", nextPacket.Packet);
m_PacketHandler.ProcessInPacket(nextPacket);
}
else
{
DebugPacket("OUT", nextPacket.Packet);
if (m_debugPacketLevel > 0)
DebugPacket("OUT", nextPacket.Packet);
m_PacketHandler.ProcessOutPacket(nextPacket);
}
}