libplanet
libplanet copied to clipboard
Introduce Span<T> to StunMessage
After C# 7.2 & System.Memory, Span<T> was introduced to reduce heap allocation. It would be great if we can apply it to StunMessage's parsing process to improve performance.
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.
As you said, C# 7.2 introduced Memory<T>, Span<T> and they help memory management effect But it seems not to support Stream.ReadAsync(Memory<T>), Stream.ReadAsync(Span<T>). There is only Stream.ReadAsync(byte[]) in .netstandard2.0.
Futrhermore, Libplanet target multiple frameworks, .netcoreapp3.0 and .netstandard2.0.
Though it was tried, but it couldn't be applied sadly because of them.
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.
@longfin May I close this issue?
As @moreal mentioned, seems like dotnet does not support Stream.ReadAsync(Span<T>) at all. (only Stream.ReadAsync(Memory<T>) is available.)
Sure.