valyala / fasthttp

Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http
MIT License
21.71k stars 1.75k forks source link

Is this the fastest http server for go 2020? #710

Closed Fenny closed 4 years ago

Fenny commented 4 years ago

Hello,

I started go one month after nodejs could not bring the performance to the table that I needed. When searching for fast http frameworks, fasthttp was in the top 20.

But the top 5 (according to benchmarks) are dominated by rust.

PS: Coming from nodejs, I ( and probably many others ) are used to the expressjs framework. Since all routers that are made for fasthttp are either non-maintained or outdated, can we expect a build-in router into fasthttp?

Something like rust did with nickel.rs

Thank you!

proyb6 commented 4 years ago

Why is the reason rust beats almost every language out there in http performance? Rust is known for not having garbage collection.

Is fasthttp currently the fastest http framework in go? According to these simple routers benchmark, yes, https://github.com/the-benchmarker/web-frameworks/blob/master/README.md

But you still need to specify your requirements for using Go, and recommend profiling with pprof to find other bottleneck in the Go application.

There is a router: https://github.com/fasthttp/router

LeMoussel commented 4 years ago

There is also fork valyala/fasthttprouter forked from buaazp/fasthttprouter forked from julienschmidt/httprouter

And you can see savsgio/atreugo High performance and extensible micro web framework with zero memory allocations in hot paths. It's build on top of fasthttp.

kirillDanshin commented 4 years ago

@LeMoussel actually, we maintain github.com/fasthttp/router