3 ms·
I find the comments most interesting. An example: For us, one of the biggest latency wins comes from the fact that go can truly execute sql statements in paral
by joss82 12y ago
I find the comments most interesting. An example:
For us, one of the biggest latency wins comes from the fact that go can truly execute sql statements in parallel (whereas python's GIL serialized these parallelizable operations). In general, single-threaded go is at least 5x faster than pure python (without c-module).
- zzzcpan 12y agoThey are not executed in parallel though, only asynchronously.
- noselasd 12y agoHow/why are they not executed in parallel ?
- themartorana 12y agoThey MAY be executed in parallel. Concurrency != parallelism[0] BY DEFAULT. That said, if you're running Go against n number of CPUs, then yes, the concurrency may in fact happen in parallel. [0] http://blog.golang.org/concurrency-is-not-parallelism http://blog.golang.org/concurrency-is-not-parallelism
- roller 12y agoIt's a slightly odd comment, SQL queries performed by a C driver are one of the times that you actually get to release the GIL and let the thread do its work without the python interpreter. Depending on the SQL engine, you're ok waiting for the sql backend in parallel, but you may suffer single threaded python object creation processing the result set.
- sandGorgon 12y agothat is interesting - does Gevent not give this in python (or twisted) ?
- vbit 12y agoIt does. I execute many db and filesystem queries in parallel with single threaded Python using gevent. I'm not quite sure whether dropbox didn't or couldn't get gevent or a similar system to work - it's fairly straightforward.
- rudolf0 12y agoI'm a huge fan of Python and gevent, and not the biggest fan of Go, but there's something to be said about built-in concurrency constructs like goroutines compared to something quite hacky like gevent (gevent.monkey.patch_all() everywhere). gevent is my favorite async networking library for Python, and I use it in almost all of my projects, but one can't deny it's basically one giant hack over CPython.
- vbit 12y agoI agree that gevent is a hack. however goroutines correspond to greenlets rather than gevent. You could write clean asynchronous io libraries in python using just greenlets and then it's not a hack. I wonder if dropbox evaluated this option or just rejected python outright.
- rudolf0 12y agoTrue, but the API for pure Greenlets is a bit ugly. In Go, the API for goroutines and channels is superb, concise, and clear. For me, the negative traits of Go outweigh the positive, but I really wish other languages would adapt some of its concurrency constructs as native language features.