fix: Fixes benchmarks (#729)
This commit is contained in:
parent
0dc4acc164
commit
1a336752a6
3 changed files with 8 additions and 1 deletions
|
|
@ -16,6 +16,7 @@ namespace Server.Tests
|
|||
void AppendLayout(bool val);
|
||||
void AppendLayout(int val);
|
||||
void AppendLayout(uint val);
|
||||
void AppendLayout(Serial serial);
|
||||
void AppendLayoutNS(int val);
|
||||
void AppendLayout(string text);
|
||||
void AppendLayoutNS(string text);
|
||||
|
|
@ -89,6 +90,8 @@ namespace Server.Tests
|
|||
m_Layout.Write(m_Buffer, 0, bytes);
|
||||
}
|
||||
|
||||
public void AppendLayout(Serial serial) => AppendLayout(serial.Value);
|
||||
|
||||
public void AppendLayoutNS(int val)
|
||||
{
|
||||
var toString = val.ToString();
|
||||
|
|
@ -232,6 +235,8 @@ namespace Server.Tests
|
|||
m_LayoutLength += bytes;
|
||||
}
|
||||
|
||||
public void AppendLayout(Serial serial) => AppendLayout(serial.Value);
|
||||
|
||||
public void AppendLayoutNS(int val)
|
||||
{
|
||||
var toString = val.ToString();
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace Benchmarks
|
|||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static void Write(this Span<byte> data, ref int pos, Serial serial)
|
||||
{
|
||||
BinaryPrimitives.WriteUInt32BigEndian(data.Slice(pos, 4), serial);
|
||||
BinaryPrimitives.WriteUInt32BigEndian(data.Slice(pos, 4), serial.Value);
|
||||
pos += 4;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -111,6 +111,8 @@ namespace Server.Network
|
|||
UnderlyingStream.Write(m_Buffer, 0, 2);
|
||||
}
|
||||
|
||||
public void Write(Serial serial) => Write(serial.Value);
|
||||
|
||||
/// <summary>
|
||||
/// Writes a 4-byte signed integer value to the underlying stream.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue