News for hackers. Stuff that matters.
Re:Golang web frameworks benchmark by jsherer on Thursday February 05, 2015 @03:36PM (#9005853)
Genuinely curious, are there any cases of production Go environments where routing is the bottleneck of their HTTP services? I'd think any kind of data access in the service would be the bottleneck, not routing.
Re:Golang web frameworks benchmark by VanillaCafe on Thursday February 05, 2015 @04:13PM (#9006143)
The way I look at it is composing benchmarks to estimate the upper bound on the number of pages that can be served per second.

So for GITHUBALL for instance:

* BenchmarkHttpRouter_GithubAll at 66732 ns/op serves at most 15k pages/second/server, versus say

* BenchmarkGoji_GithubAll at 752515 ns/op serves at most 1.3k pages/second/server

Or for GPLUSALL

* BenchmarkHttpRouter_GPlusAll at 3258 ns/op serves at most 310k pages/second/server, versus

* BenchmarkGoji_GPlusAll at 15260 ns/op serves at most 66k pages/second/server

Re:Golang web frameworks benchmark by elmin on Thursday February 05, 2015 @03:51PM (#9005985)
This is my question as well. With the exception of some very specialized applications, I can't see why any of this would have a significant impact on the real world performance of actual services.
Re:Golang web frameworks benchmark by elithrar on Thursday February 05, 2015 @04:04PM (#9006083)
Extremely few. 99%+ of your bottleneck will be in template rendering or DB access. Routing is so fast as to not matter for even "large" web applications.
Re:Golang web frameworks benchmark by rdtsc on Thursday February 05, 2015 @04:18PM (#9006174)
Can imagine it might be it is used as a proxy/gateway to set of servers that then do data access.
Re:Golang web frameworks benchmark by falcolas on Thursday February 05, 2015 @03:56PM (#9006024)
Silly question, but where's the "plain net/http" benchmark? I haven't found a case where I've missed having an http framework.

Would be interesting to see what the baseline is.

Re:Golang web frameworks benchmark by maximveksler on Friday February 06, 2015 @08:31AM (#9008840)
Basically there aren’t much reasons besides security considerations to use net/http multiplexer at all.

The baseline was profiled under STATICALL as the default net/http multiplexer does not support dynamic paths http://golang.org/pkg/net/http/#ServeMux. The benchmark is named BenchmarkHttpServeMux_StaticAll you can read the code at https://github.com/julienschmidt/go-http-routing-benchmark/b.... Frankly, net/http it not a very good http router. The results show that julienschmidt/httprouter trie based implementing outperforms net/http by 60x.

Re:Golang web frameworks benchmark by Yadi on Thursday February 05, 2015 @03:12PM (#9005676)
I know this is a dumb question, but is there a conclusion to the benchmarks that which one would be more ideal to use?

I'm just learning GO, that is why I'm asking.

Re:Golang web frameworks benchmark by Zikes on Thursday February 05, 2015 @03:17PM (#9005715)
I think the tl;dr at the top of the page answers that the best:

    HttpRouter is the king of performance, scoring first on ALL tests. 
    2nd place goes to ace if you don’t need middleware, and Gin if you do. 
    3rd place goes to Goji which is mature, stable and all things considered awesome.
Re:Golang web frameworks benchmark by Yadi on Thursday February 12, 2015 @09:38PM (#9042601)
Thanks!
Re:Golang web frameworks benchmark by Inflatablewoman on Thursday February 05, 2015 @03:25PM (#9005772)
Very interesting. Thanks for posting this. I have been using TigerTonic, but will give Gin a go after reading this.
Re:Golang web frameworks benchmark by maximveksler on Thursday February 05, 2015 @03:39PM (#9005874)
I hope to not disappoint you, or us as a matter of fact :) hit us up on @hellodebug we will be building this open sourced.
Re:Golang web frameworks benchmark by ch4s3 on Thursday February 05, 2015 @02:20PM (#9005265)
Wow, I knew Gin was supposed to be faster than martini, but seeing that large of a spread was pretty interesting.
Re:Golang web frameworks benchmark by beckler on Thursday February 05, 2015 @02:37PM (#9005396)
Not totally sure, but I think Gin is faster because it uses HttpRouter under the covers.
Re:Golang web frameworks benchmark by dougbarrett on Thursday February 05, 2015 @04:26PM (#9006234)
And httprouter is a bit limited as far as what you can do with the url rules, understadibly. I've documented it here:

https://www.dougcodes.com/go-lang/gin-gonic-may-be-40x-faste...

and here:

https://www.dougcodes.com/go-lang/martini-to-gin-back-to-mar...

Negroni/Gorilla Mux seems to be a good combination for me, but Jeremy Saenz is coming out with a new mux that I'm interested in trying when it's released to see how it compares to Gorilla Mux.

Re:Golang web frameworks benchmark by ch4s3 on Thursday February 05, 2015 @04:20PM (#9006193)
Re:Golang web frameworks benchmark by landr0id on Thursday February 05, 2015 @02:56PM (#9005551)
I'm kind of surprised Negroni wasn't among those tested.
Re:Golang web frameworks benchmark by rlbaker on Thursday February 05, 2015 @03:14PM (#9005687)
I believe that Negroni is considered a library rather than a framework. https://github.com/codegangsta/negroni#is-negroni-a-framewor...

But I don't know why that would preclude it from these benchmarks because httprouter is not a full fledged framework either.