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

HttpRequestStream & DuplexPipeStream don't amortize their ValueTask ReadAsync calls #11940

Open
benaadams opened this issue Jul 7, 2019 · 0 comments
Labels
affected-very-few This issue impacts very few customers area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions enhancement This issue represents an ask for new feature or an enhancement to an existing one Perf severity-nice-to-have This label is used by an internal tool
Milestone

Comments

@benaadams
Copy link
Member

benaadams commented Jul 7, 2019

In usage a HttpRequestStream & DuplexPipeStream normally has very many ReadAsync calls made on them. (Use case WebSockets/SignalR over TLS)

Using the ValueTask overloads for these Streams read allocates a AsyncStateMachineBox per read (when data is not immediately available)

image

However it could use TryRead for the sync-path and allocating a IValueTaskSource object the first time that fails to back the async read, and then reuse it each time the read needs to go async again.

Related https://github.com/dotnet/corefx/issues/39258

@analogrelay analogrelay added this to the Backlog milestone Jul 9, 2019
@jkotalik jkotalik added affected-very-few This issue impacts very few customers enhancement This issue represents an ask for new feature or an enhancement to an existing one severity-nice-to-have This label is used by an internal tool labels Nov 13, 2020 — with ASP.NET Core Issue Ranking
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affected-very-few This issue impacts very few customers area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions enhancement This issue represents an ask for new feature or an enhancement to an existing one Perf severity-nice-to-have This label is used by an internal tool
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants