-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
SslStream doesn't amortize its ValueTask ReadAsync calls #30168
Comments
Difficult to do manually, and will complicate the code significantly. Unless you're planning to tackle this soon and find a way to keep it manageable in the process, I suggest you close the issue, or it is just going to sit open for a very long time. |
I'm looking to see if can use IAsyncEnumerable as adding the new type that way is very simple (changing However, I'm having some issue then gluing that to the |
*Am trying it on HttpRequestStream first dotnet/aspnetcore#11940 |
Triage: @wfurt is working on SslStream redesign. If we still have perf opportunity after it is done, we may reopen this issue. |
@wfurt's changes are not affecting this. |
what should we do about this @stephentoub ? you suggested to close this earlier. Do you have sense how much this can help? |
It's fine closing it, I just wanted to point out that this opportunity is still relevant after your changes. I'm not sure how much it would help. An easy way to get some sense would be to turn on the feature flags I merged in dotnet/coreclr#26310, and run a benchmark around SslStream, to see what impact it has on allocation and throughput, if any. |
In usage a SslStream normally has very many ReadAsync calls made on it. (Use case WebSockets/SignalR over TLS)
Using the ValueTask overloads for SslStream read allocates 2x AsyncStateMachineBox per read (when data is not immediately available)
However it could allocate once; backing with an IValueTaskSource objects that get allocated for the first async and reused when the read goes async again.
The text was updated successfully, but these errors were encountered: