planetarium / libplanet

Blockchain in C#/.NET for on-chain, decentralized gaming
https://docs.libplanet.io/
GNU Lesser General Public License v2.1
506 stars 141 forks source link

Introduce Span<T> to StunMessage #603

Open longfin opened 4 years ago

longfin commented 4 years ago

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.

stale[bot] commented 4 years ago

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

moreal commented 4 years ago

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.

stale[bot] commented 4 years ago

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