Live data from Hacker News

Why we switched from Python to Go

getstream.io

401–406 of 406 posts

Re: Why we switched from Python to Go

#401
post #313

Earlier quoted context omitted.

> It'd be great if there were better benchmarks for common use cases of various languages Somebody should make those. (People may have different ideas about which use cases are common).

There are some: https://www.techempower.com/benchmarks/ As you can see, erlang is far from the top there.

It's not near the bottom either which is the point. Actually Phoenix (the only Erlang base web framework I could find at the link) edges out quite a number of other frameworks, roughly ranking in the middle of the pack. Specifically Phoenix performed 32k req/s, in comparison to say the Go based Gin which does 51k req/s or a arguably more comparable setup of,Python3 Flask with full ORM at 13k. Spring only manages in 23k req/s. Nothing to write home about either way but clearly along the lines of my argument that Erlang/Beam can hold its own. Though some of the ruby frameworks are damn impressive seaming, huh.

However it gets more interesting if you look at the Latency tab. There Phoenix comes in with an average of 7.9 ms. In comparison Gin averages 5.8 ms, Spring at 12.1 ms, Flask Py3 at 23.1 or Py2 at 14.7 ms.

Where it's really interesting is looking at the max latency. Presuming this indicates roughly how 99th and 95th percentiles measurements would compare. In this category Phoenix comes in second with a max of 22.0 ms, behind only lib-mongodb at 20.8 ms. The lib-Mongolia is one of the fastest frameworks by raw req/s.

Appreciate the link to the benchmarks! Much more interesting, especially if you're concerned about max latency (and likely 99/95 th percentiles). In this case BEAM/Phoenix would let you plan capacity to minimize max latency fairly well as it appears very consistent.

Re: Why we switched from Python to Go

#402
post #400

Earlier quoted context omitted.

Forking 10 processes does not use 10x the memory of a single process starting 10 threads. It's actually almost identical. Both are implemented by the kernel using clone(). Many older tools written in "fast" languages like PostgreSQL and Apache also use forking.

We're not talking about forking here. Python/Ruby apps are actually spawned as several separate processes.

Not for almost a decade. Ruby web servers and job processing frameworks have used forking out of the box since the release of Phusion Passanger 2 in 2008 and Resque in 2009.

Re: Why we switched from Python to Go

#403

Earlier quoted context omitted.

hi riku_iki, I just checked out the link akka.io and it says that it caters to java/scala only ... from your last statement I understood that it was meant for java and go.

Go also has tons of actor frameworks: https://github.com/AsynkronIT/protoactor-go But it also has native coroutines embedded into language, which provide excellent asynchronous performance.

Hey thanks for that link ... I was aware of go having coroutines available as part of the language but not that something similar to what erlang provided was available to the go system as well...

Re: Why we switched from Python to Go

#404

Earlier quoted context omitted.

There are some: https://www.techempower.com/benchmarks/ As you can see, erlang is far from the top there.

It's not near the bottom either which is the point. Actually Phoenix (the only Erlang base web framework I could find at the link) edges out quite a number of other frameworks, roughly ranking in the middle of the pack. Specifically Phoenix performed 32k req/s, in comparison to say the Go based Gin which does 51k req/s or a arguably more comparable setup of,Python3 Flask with full ORM at 13k. Spring only manages in 2…

> Specifically Phoenix performed 32k req/s,

But raw java servlets delivered 100+k req/s. It may mean that all this event loop/async/actors hype is overrated, and regular blocking approach can also deliver.

Re: Why we switched from Python to Go

#405
post #399

Earlier quoted context omitted.

They have elixir there, which is another language for Erlang VM, and they have erlang for other benchmarks.

JRuby is another language for JVM -- do you put forward JRuby as the example of JVM performance?

It has very different paradigm (dynamic vs static typing) with very strong performance implication.

Re: Why we switched from Python to Go

#406
post #124

Earlier quoted context omitted.

And reddit. And a little thing called youtube (though to be fair last I read they're offloading a lot of the hot paths to golang and c via native modules).

Curious, where do you see that youtube is running Django? Python, maybe, but I don't think they run Django?

My apologies, I thought OP said 'Python' not 'DJango'. You're correct. Youtube has their own framework and IIRC reddit runs a few different Pyramid modules rather than a full-fat framework.

Reddit has some scattered Engineering blogs and my insight into youtube comes from a previous HN article by the author of GrumPy (who works on youtube at Google) in case you're curious.

Post reply on HN