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

Add optimized ReadAll for http responses #183

Merged
merged 1 commit into from
Feb 13, 2024

Commits on Feb 12, 2024

  1. Add optimized ReadAll for http responses

    1. When the body content length is known it's much faster to
    pre-allocated the entire buffer once.
    2. When the length is unknown using `bytes.NewBuffer` + `io.Copy` is
    much faster.
    
    Also, added benchmarks to prove the difference.
    rdner committed Feb 12, 2024
    Configuration menu
    Copy the full SHA
    212ef1b View commit details
    Browse the repository at this point in the history