mroth/phoenix-showdown

Compare to gin

Closed this issue · 6 comments

gin is a optimized Go based framework much based on Martini. It would be great to see how it fits in with this benchmark.

Most go shops don't actually use a framework because the http package in the standard library has most of the functionality of a web framework. It'd be interesting to compare it against that.

Square had a good post on go frameworks: http://corner.squareup.com/2014/05/evaluating-go-frameworks.html

@peterbe pull requests are welcome!

Gin looks interesting. If you can PR a skeleton project I'd be happy to include it next time I re-run these benchmarks.

@thebyrd the purpose of these particular benchmarks were to compare "Sinatra-like" micro frameworks. Sure, you can get better performance in Go by dropping to native libraries, just like you can in by using Rack in Ruby, or using native erlang HTTP lib in Elixir. That's not really the point -- the goal it to compare similar toolsets with similar ease of development. If you compare the frameworks in here, they are remarkably similar in terms of code structure despite being in different languages, because they all inspired from the same spiritual parent (Sinatra). This would not be the case using Go HTTP package without a framework.

That said, if you want to do benchmarks of native raw HTTP library performance across languages, I'm sure there is something interesting to be found there and would be a good blog post subject, especially if you compare the ease of use of the native libraries without a framework. If this interests you, I encourage you to try doing so!

I just opened a PR for a Gin based benchmark:

#3

Since there is now a PR for this I'm going to close this issue as duplicate in favor of the PR at #3 for discussion and merging. Thanks all!

There's nothing about Martini which makes it any more similar to Sinatra than other more idiomatic Go frameworks. There are other routing libraries with much better performance that don't use reflection and various default middleware that this benchmark included, yet still have a simple API to define routes that are handled by handler functions.