Hacker News new | ask | show | jobs
by acln 2839 days ago
I like my HTTP package to actually speak as good an approximation of HTTP as it can, so fasthttp wouldn't be my first option.

Furthermore, the HTTP stack doesn't show up on most web servers' profiles. net/http is better understood by the community, interoperates with libraries better (e.g. golang.org/x/oauth2), and is better supported.

Use net/http.

1 comments

The main issue with net/http is that it generates a lot of garbage which is definitely going to show up in your profile if you're handling a lot of requests per second.
Allocation pressure imposed by net/http has never been a top K source of profile CPU burn in any service I’ve ever written, and I’ve written plenty of high-performance, high-QPS services. fasthttp is rarely if ever a good idea.