Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Span<T> to StunMessage #603

Closed
longfin opened this issue Oct 23, 2019 · 5 comments
Closed

Introduce Span<T> to StunMessage #603

longfin opened this issue Oct 23, 2019 · 5 comments
Labels
good first issue Good for newcomers hacktoberfest Newcomer-welcoming issues for Hacktoberfest help wanted Extra attention is needed

Comments

@longfin
Copy link
Member

longfin commented Oct 23, 2019

Context

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.

Tips

  • Because .netstandard2.0 doesn't support Stream.ReadAsync(Memory<T>) and Stream.ReadAsync(Span<T>), you'll need to branch through a preprocessor. Then this MSDN docs will be helpful.
@longfin longfin added help wanted Extra attention is needed good first issue Good for newcomers labels Oct 23, 2019
@stale
Copy link

stale bot commented Dec 22, 2019

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

@stale stale bot added the stale The issue is stale label Dec 22, 2019
@moreal
Copy link
Contributor

moreal commented Dec 24, 2019

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 stale bot removed the stale The issue is stale label Dec 24, 2019
@stale
Copy link

stale bot commented Feb 22, 2020

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

@stale stale bot added the stale The issue is stale label Feb 22, 2020
@Atralupus Atralupus added the hacktoberfest Newcomer-welcoming issues for Hacktoberfest label Oct 10, 2024
@stale stale bot removed the stale The issue is stale label Oct 10, 2024
@moreal moreal removed help wanted Extra attention is needed good first issue Good for newcomers hacktoberfest Newcomer-welcoming issues for Hacktoberfest labels Oct 10, 2024
@moreal moreal added help wanted Extra attention is needed good first issue Good for newcomers hacktoberfest Newcomer-welcoming issues for Hacktoberfest labels Oct 10, 2024
@OnedgeLee
Copy link
Contributor

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

@longfin
Copy link
Member Author

longfin commented Oct 25, 2024

Sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers hacktoberfest Newcomer-welcoming issues for Hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants