Reduce allocations in Quic/HTTP3 - #104394
Merged
Merged
Conversation
Contributor
|
Tagging subscribers to this area: @dotnet/ncl |
Member
Author
|
/azp run runtime-libraries-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
ManickaP
reviewed
Jul 4, 2024
ManickaP
left a comment
Member
There was a problem hiding this comment.
Before this PR, WritesClosed was handled right after completing writes, logically next to each other. Now, the logic is split in different places. I know it's more efficient, but IMHO it's much harder to follow now and not mess up in the future.
I'll not block this PR on this, I'm just sharing my perspective.
This was referenced Jul 5, 2024
Open
Member
Author
|
/azp run runtime-libraries-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
ManickaP
approved these changes
Jul 8, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As of #104035 we're now waiting for
WritesClosedon every request, and paying for the allocations backing thatTask. This PR attempts to claw that perf back.This does a couple of things:
ResettableValueTaskSource's final task was already signaled by the time someone first asked for theTask, avoid allocating the intermediateTaskCompletionSourceand itsTask.WritesClosedlater on in Http3'sSendAsync(after receiving the response) to make it more likely thatWritesClosedwill have been completed by the time we check, thus avoiding the allocations.cancellationTokenwhile waiting forWritesClosed-- @ManickaP I'm guessing that's desirable here?FlushSendBufferAsync