-
Notifications
You must be signed in to change notification settings - Fork 10.3k
HTTP/3: Http3Stream pooling #34576
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
HTTP/3: Http3Stream pooling #34576
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems OK in general once the build is fixed. I'm curious to see the benchmarks.
4a31edd
to
899e200
Compare
_streamLifetimeHandler.OnStreamCreated(stream); | ||
|
||
ThreadPool.UnsafeQueueUserWorkItem(stream, preferLocal: false); | ||
} | ||
else | ||
{ | ||
var persistentStateFeature = streamContext.Features.Get<IPersistentStateFeature>(); | ||
Debug.Assert(persistentStateFeature != null, $"Required {nameof(IPersistentStateFeature)} not on stream context."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems too possible to just assert given the transport is pluggable. Let's null-check and throw.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also look forward to the benchmarks.
899e200
to
858d3ee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New and renamed files need MIT license headers
I thought I had already updated old files. Which ones still need to be updated? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought I had already updated old files. Which ones still need to be updated?
I must have looked at this and still had an older copy of the changes cached. Sorry.
I don't see another way to remove my changes request and am signing off only on the headings.
Fixes #33680
This builds on top of the new
IPersistentStateFeature
.Http3Stream and many of its associated types (pipes, output producer, decoder) are now reused between requests.
In this PR I also added some basic microbenchmarks that do HTTP/3. Refactoring the test code so it is usable in microbenchmarks is the major of line changes in this PR.
I will get benchmarks comparing allocations before and after.