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

Replace bufferedSubStreamOutput in Http2Demux with direct access to stream state machine #330

Open
jrudolph opened this issue Oct 11, 2023 · 0 comments
Labels
enhancement New feature or request performance Relating to performance

Comments

@jrudolph
Copy link
Contributor

Right now, we dispatch substreams as soon as they are incoming / we detect them into bufferedSubStreamOutput. Instead, we can let them be pulled and query the state machine whether a stream is ready to be dispatched. In particular, this will automatically avoid allocating infrastructure for streams that might never materialize (e.g. because they are cancelled before they will be pulled).

One way to do it would be to introduce a kind of "holding position" state. In that state, we could also already start collecting incoming data (which we have to buffer anyway up to the default window size). In the best case, we have already seen endStream = true for the request side, so that we can avoid setting up the expensive streaming infrastructure (this will mean that in overload cases we will "automatically" reduce work because we collect buffers early on when there is backpressure from the stream handling flow).

@jrudolph jrudolph added enhancement New feature or request performance Relating to performance labels Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance Relating to performance
Projects
None yet
Development

No branches or pull requests

1 participant