msgpack-cli icon indicating copy to clipboard operation
msgpack-cli copied to clipboard

Span<byte> based API

Open yfakariya opened this issue 8 years ago • 1 comments

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.
  • ArraySegment<byte>, Span<byte>, and ReadOnlySpan<byte> also should be supported.

As far as I think, unified as Span<byte> for serialization and ReadOnlySpan<byte> for deserialization is reasonable.

yfakariya avatar Apr 11 '17 13:04 yfakariya

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.

yfakariya avatar Aug 12 '17 14:08 yfakariya