HttpRequestStream & DuplexPipeStream don't amortize their ValueTask ReadAsync calls #11940
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
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)
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
The text was updated successfully, but these errors were encountered: