6 ms·
I know benchmarks should be taken with a pinch of salt, but by round 5 I was totally into Scala (Scalatra), trying to write my own framework, so I could get bet
by neya 13y ago
I know benchmarks should be taken with a pinch of salt, but by round 5 I was totally into Scala (Scalatra), trying to write my own framework, so I could get better bang for buck from my EC2 instances, which to be honest, aren't cheap when compared to say, Digital Ocean.
Around round 6 of these benchmarks, I ditched Scala altogether (and also my framework).The reason I ditched Scala was not because of it's performance, etc. But it was because I was the only developer in my company who knew and learnt Scala after reading a couple of books (one was around 800 pages). Obviously, I needed a language that any other developer should have no problem taking over, and Scala developers are 1)expensive 2)not easy to find. Also, Slick (the database interacting code for Scala by Typesafe) wasn't mature yet.
For this reason, around Round 6, I started writing my own framework in GoLang and used it internally as an 'auxiliary framework'. I will explain more about this framework soon soon. In my company, we have about a handful of backend programmers and a couple of frontend devs. I found that GoLang was much much easier to teach my programmers, than say I could teach Scala. Please note - Scala is a brilliant functional programming language, but if you are thinking switching from Ruby/Python/etc would be easy, then you are wrong.
Now, we have a workflow that allows us to deliver as quickly as possible, but without missing out on performance - We write our entire V1 in Rails. We implement all the UI/frontend related code and then port it to our GoLang framework. We have an internal generator where we just feed our rails app, and the code for our framework is just 'ported'/generated on the fly based on our framework and we just deploy it. So far, our productivity is slightly lost while handling the type conversions, bugs, etc. But it's totally worth it. Go outperforms Rails by a huge margin. I noticed that using something like Puma helps a lot, but it still is no way comparable to our GoLang framework.
As for our framework, it's just pretty simple - Just organize all the files as you would in a Rails application (Models/Views/Controllers/Config) and everything just works without much performance hiccups. We use Gorilla components for stuff like routing and cookies. The rest of the stuff is slightly adapted from other frameworks (like Martini).
All in all, I love the ability to have JVM like performance with the productivity of Ruby with a language like GoLang. And this round 8 benchmark is nothing short of impressive. If you haven't tried GoLang yet, you should try writing your own framework, not only do you learn about all the trade-offs for the 'magic' that rails makes under the hood, you also learn about some new stuff and thus become a better programmer.
I think GoLang is pretty impressive if someone as average as me can even write a framework like Rails, except for better performance. Give it a try, people, you won't be disappointed.
- quaunaut 13y agoThis is what I've been exploring in the past couple of weeks. I love the frontside MVC framework position, and being able to build out a resource, hook it up as JSON, then just hop over to Go and recreate it with a clear goal in mind has been a lot of fun. I don't need the performance as bad as many- this is more me just trying to still figure out 'my' language(I'm not long in the industry). Go is starting to feel like it could be it, but it's hard to deny how quick Rails is for getting up and running in record times.
- kvtrew76557 13y agoThe numbers vary greatly, depending on which test you look at. In the plaintext search Go only comes in at 13th: http://www.techempower.com/benchmarks/#section=data-r8&hw=i7&test=plaintext http://www.techempower.com/benchmarks/#section=data-r8&hw=i7...
- RyanZAG 13y agoGo also suffers heavily when resource constrained - eg, run on EC2 or digital ocean which most people here are going to be running on. The large amount of garbage generated by Go paired with stop the world GC is the reason there. If you're running directly on high processor machines without much disk access then Go is a good bet, otherwise you'd nearly always be better off with Java - especially when you consider how many well tested OSS libraries are available for everything.
- MetaCosm 13y agoIf you look at the Go standard library, it doesn't generate too much garbage. It is avoidable often, don't use .String, use .WriteTo -- the GC cost is not across all used memory, just memory with live pointers.
- babawere 13y agoyou also need check the errors , most of the languages in to 12 returned too many errors or failed during the request
- 13y ago