Benchmark for execution test written
This commit is contained in:
1 parent
0f355b9df3
commit
c29db73a0e
12 files changed
+237
-28
No files matched your search
@@ -19,12 +19,12 @@ public static class CborExtensions
|
||||
MemoryMarshal.Write(span, ref id);
|
||||
writer.WriteByteString(span);
|
||||
}
|
||||
|
||||
|
||||
public static void WriteToDest(this RequestId id, Span<byte> destination)
|
||||
{
|
||||
MemoryMarshal.Write(destination, ref id);
|
||||
}
|
||||
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
|
||||
public static unsafe void WriteToCborOpt(this RequestId id, CborWriter writer)
|
||||
{
|
||||
@@ -32,4 +32,17 @@ public static class CborExtensions
|
||||
MemoryMarshal.Write(span, ref id);
|
||||
writer.WriteByteString(span);
|
||||
}
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static RequestId ReadFromTrueCbor(CborReader reader)
|
||||
{
|
||||
var enc = reader.ReadEncodedValue(true);
|
||||
return MemoryMarshal.Read<RequestId>(enc.Span[1..]);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static RequestId ReadFromCbor(CborReader reader)
|
||||
{
|
||||
var enc = reader.ReadEncodedValue();
|
||||
return MemoryMarshal.Read<RequestId>(enc.Span[1..]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user