

Show HN: Go HTTP Request Router Benchmark - JulienSchmidt
https://github.com/julienschmidt/go-http-routing-benchmark

======
moe
It's currently very hard to digest any information from this. Some bar-charts
would be helpful.

~~~
awda
Or just sorting the results by performance, rather than alphabetically.

------
roncohen
Would be great to see a benchmark of how much time is actually spent in
routing compared to all the other disciplines involved in responding to a HTTP
request. For any interesting application, I suspect routing will be the least
of your troubles in regards to performance.

~~~
JulienSchmidt
For most web-apps this is definitely true. But an efficient router doesn't
hurt either. If the router scales well, the routing part will never become
your bottleneck. If the router is also memory efficient, it can reduce the
amount of time the Garbage Collector needs.

~~~
pekk
The point was that the routing part is highly unlikely to become your
bottleneck in any case.

------
tedchs
I am so glad to see the benchmarks' source code here. So often these
"performance" blog posts get written in a completely unreproducible way. A
core element of the scientific method is that others can reproduce your
experiment to validate or disprove your results.

------
Matheo05
So the one you recommend is the one you wrote yourself?

~~~
JulienSchmidt
I'd recommend Goji to most users. The one I wrote has better performance, but
also less features.

~~~
elithrar
Goji does very well given it includes a request context implementation as
well. I've been porting over an existing net/http + gorilla/mux app and like
its design.

------
kinofcain
Thanks for the benchmark, I didn't know half these projects existed.

One thing that affects Gorilla mux is that this test is putting all the routes
at the top-level instead of constructing subroutes based on the logical route
hierarchies.

Certainly the fact that HttpRouter constructs that prefix tree for you is a
huge feature, and the speed is impressive, but it's not a typical/canonical
usage of Gorilla mux.

I don't know if that's the case with the other routers or not.

~~~
JulienSchmidt
Contributions are welcome ;)

~~~
kinofcain
Yeah yeah yeah ;)

------
smalu
What about Revel framework?

~~~
JulienSchmidt
Revel is a bit too magic. It is hard to benchmark the routing alone.

------
juliendsv-mbm
What about Negroni ?

~~~
mtalantikite
Negroni doesn't have a router built in, and these benchmarks are only looking
at the router components.

