Skip to content
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

Request body iteration specialisation #611

Merged
merged 4 commits into from
Nov 18, 2024
Merged

Conversation

adam-fowler
Copy link
Member

@adam-fowler adam-fowler commented Nov 16, 2024

The majority of time the request body is a NIOAsyncChannelRequestBody. This PR adds a specialisation for this type. So instead of going through AnyAsyncSequence it calls the NIOAsyncChannelRequestBody iterator next() function directly. The results are a slight improvement in performance, when parsing small request buffers, although not that much 64K - 65K requests.

I mistakenly made NIOAsyncChannelRequestBody public with the HTTP2 changes. In this PR I make it a struct to avoid an additional allocation. I have also changed the public to package. In theory these changes are breaking. But they will affect basically no one, unless they decided to write their own HTTP1 channel handling code in the last 3 days.

@adam-fowler adam-fowler requested a review from Joannis as a code owner November 16, 2024 13:10
Copy link

github-actions bot commented Nov 16, 2024

@adam-fowler adam-fowler enabled auto-merge (squash) November 18, 2024 16:36
@adam-fowler adam-fowler merged commit 209e01d into main Nov 18, 2024
6 of 7 checks passed
@adam-fowler adam-fowler deleted the request-body-iteration branch November 19, 2024 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants