libplanet icon indicating copy to clipboard operation
libplanet copied to clipboard

Introduce Span<T> to StunMessage

Open longfin opened this issue 6 years ago • 3 comments

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.

longfin avatar Oct 23 '19 08:10 longfin

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

stale[bot] avatar Dec 22 '19 09:12 stale[bot]

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.

moreal avatar Dec 24 '19 07:12 moreal

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

stale[bot] avatar Feb 22 '20 08:02 stale[bot]

@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.)

OnedgeLee avatar Oct 25 '24 12:10 OnedgeLee

Sure.

longfin avatar Oct 25 '24 12:10 longfin