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

HttpClient: Adds optimization to avoid double buffering response #1835

Merged
merged 6 commits into from
Sep 11, 2020

Conversation

j82w
Copy link
Contributor

@j82w j82w commented Sep 3, 2020

Pull Request Template

Description

If you set HttpClient request to use HttpCompletionOption.ResponseContentRead then HttpClient will buffer the response. The response is then copied over to a memory stream causing it to create another buffer. This change sets all request to HttpCompletionOption.ResponseHeadersRead. This way HttpClient does not buffer the content.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • [] New feature (non-breaking change which adds functionality)
  • [] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [] This change requires a documentation update

Closing issues

closes #1828

@j82w j82w merged commit 8c31ca0 into master Sep 11, 2020
@j82w j82w deleted the users/jawilley/perf/httpDoubleBuffer branch September 11, 2020 20:35
@ghost
Copy link

ghost commented Dec 15, 2021

Closing due to in-activity, pease feel free to re-open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GatewayStoreClient buffers entire response body and makes another copy of it for later use
5 participants