Uh oh!
There was an error while loading. Please reload this page.
Avoid allocations in ClientWebSocket.ConnectAsync in the common case - #75025
Conversation
ghost
commented
Sep 2, 2022
Tagging subscribers to this area: @dotnet/ncl Issue Details
For the following test case usingvarcws=newClientWebSocket();awaitcws.ConnectAsync(uri,CancellationToken.None);This saves about ~10% of the allocations (20.164 => 17.940).
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
MihaZupan
commented
Sep 5, 2022
/azp run runtime-libraries-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
MihaZupan
commented
Sep 5, 2022
Outerloop failures are still #74468 |



ClientWebSocketOptions.Proxyis set by default, so the shared handler wasn't being used in the common case.This PR adds a second handler field that's used when a default proxy is requested.
While we're changing this code, I also changed it to store an
HttpMessageInvokerinstead ofSocketsHttpHandler.For the following test case
This saves about ~10% of the allocations (20.164 => 17.940).
Before
After