You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please provide an efficient (zero alloc) alternative to IStateSerializer - allowing to read and write to non-contiguous memory.
public interface IStateSerializer2<T>
{
T Read(ReadOnlySequence<byte> sequence);
T Read(T baseValue, ReadOnlySequence<byte> sequence);
void Write(T value, IBufferWriter<byte> binaryWriter);
void Write(T baseValue, T targetValue, IBufferWriter<byte> binaryWriter);
}
Both structures ReadOnlySequence<byte> and IBufferWriter<byte> have wide compatibility (.NET Standard 1.1) and allow to avoid unnecessary allocations and allow to use Spans. They are perfect fit for integration with unmanaged code.
I intend to use it with my span-based protocol buffers re-implementation described here: protocolbuffers/protobuf#3431
The text was updated successfully, but these errors were encountered:
@MedAnd First I will try to get it to the main repo (at least as a pre-release) - there is some hope, because it will be probably used for gRPC server. Meanwhile I will try to implement an alternative standalone gRPC middleware. If the process will be very slow or I would be unable to get my PRs accepted I will need to create separate nuget packages for both protobuf and gRPC-middleware.
Please provide an efficient (zero alloc) alternative to IStateSerializer - allowing to read and write to non-contiguous memory.
Both structures
ReadOnlySequence<byte>
andIBufferWriter<byte>
have wide compatibility (.NET Standard 1.1) and allow to avoid unnecessary allocations and allow to useSpans
. They are perfect fit for integration with unmanaged code.I intend to use it with my span-based protocol buffers re-implementation described here: protocolbuffers/protobuf#3431
The text was updated successfully, but these errors were encountered: