Closed figuerom16 closed 1 year ago
does the adaptor create a small consistent overhead
Yeah, there is a bit of an overhead involved. See the relevant ConvertRequest
func (which btw. is now part of the fiber adaptor
middleware as well) to convert a fiber.Ctx
request to a (net/http).Request
: https://github.com/valyala/fasthttp/blob/9bc8e480c444fa6bf54a4cd79091692ceff6011c/fasthttpadaptor/request.go#L18
The overhead is not big, but if performance is crucial, you need to set up benchmarks.
I'm interested in using NGINX Unit as the app server https://unit.nginx.org/. The handler is expecting the net/http handler so the adaptor.FiberApp(app) is needed. The question is does the adaptor create a small consistent overhead or does the adaptor negate all the benefits of fasthttp?
Example: https://unit.nginx.org/howto/samples/#sample-go