-
Notifications
You must be signed in to change notification settings - Fork 633
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
Consider adding size_hint
to Stream
#170
Comments
I can see how I feel like this is a great optimization opportunity for iterators, but not necessarily streams. Would be good to have some examples in practice that this helps to evaluate as well! |
For example, if I know that the HTTP body is empty (size hint would be 0), then I could terminate the HTTP/2 stream right after the head and not need to write an empty body stream frame. |
I also think this would be useful. I've written a bunch of code of the form
|
We cannot optimize current |
This would be helpful for
Stream::collect
Also, I often create empty streams to represent no body when working w/ HTTP, it would be nice to just skip all the work if the body is empty.
The text was updated successfully, but these errors were encountered: