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

http.go: Request.SetURI() (Fix #1141) #1148

Merged
merged 1 commit into from Nov 8, 2021

Commits on Nov 7, 2021

  1. http.go: Request.SetURI() (Fix valyala#1141)

    Currently, the only way to set URI for a request is to call SetRequestURI(string).
    Then when a request performed the string will be parsed into a fasthttp.URI struct.
    If there are many requests with the same URI then we'll waste CPU for a parsing of the same URI string.
    With the new SetURI(*URI) method we can once parse a URI string into a fasthttp.URI struct and then reuse it for many requests.
    Unfortunately the URI will be copied because may be modified inside the request.
    But anyway this will be more lightweight than parsing.
    stokito committed Nov 7, 2021
    Copy the full SHA
    5da2621 View commit details
    Browse the repository at this point in the history