Fasthttp: Why not apply this to net/http?

Created on 24 Nov 2015  路  6Comments  路  Source: valyala/fasthttp

Send Go team as a patch?

Most helpful comment

FYI, I tried optimizing net/http before starting fasthttp. About 50% of memory allocations per request were shaved, but this didn't give significant performance gain. So I gave up and started fasthttp :)

All 6 comments

:+1: :+1:

Along the same lines, why does this not adhere to the same interface is net/http? Perhaps I misread the documentation, but at least ListenAndServe has a different interface.

I agree, seemed cumbersome to have to assign handlers. I would like it to follow more or less the net/http library like this https://gist.github.com/tristanwietsma/8444cf3cb5a1ac496203

@sybrandy true, deal breaker

  • net/http efficiency will never reach fasthttp due to API constraints and backwards compatibility requirements.
  • fasthttp cannot have API identical to net/http due to performance reasons.

See the FAQ for more information.

FYI, I tried optimizing net/http before starting fasthttp. About 50% of memory allocations per request were shaved, but this didn't give significant performance gain. So I gave up and started fasthttp :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Fenny picture Fenny  路  3Comments

shkreios picture shkreios  路  3Comments

facundomedica picture facundomedica  路  4Comments

jadbox picture jadbox  路  3Comments

LeMoussel picture LeMoussel  路  3Comments