My application has a bunch of fixed URLs like http://example.com/api/ and I can call the req.uri.parse() only once on initialization. And then I would like to just set this fasthttp.URI objects before sending the request with a new method SetRequestURI(preparsedUri).
Is any reason why this wasn't implemented? Will you implement this or accept a PR with such functionality?
The text was updated successfully, but these errors were encountered:
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.