msgpack-cli
msgpack-cli copied to clipboard
Span<byte> based API
There are only Stream based APIs in MessagePack for CLI, but following APIs looks usable:
byte[]based API. Sometimes (more often as I imagined) array based API is quite handy than stream based.- Some people argue that
byte[]based API has much more performance than stream based.
- Some people argue that
ArraySegment<byte>,Span<byte>, andReadOnlySpan<byte>also should be supported.
As far as I think, unified as Span<byte> for serialization and ReadOnlySpan<byte> for deserialization is reasonable.
It looks that it is limited to take advantage of Span<T> for serialization / deserialization now. Although it may be usable when corefx APIs support Span<T> for internal efficiency, I do not believe that exposing Span<T> based API is useful for users yet.