3 ms·
It took me a week struggling with Asyncio to wrap my mind around it. It took me 12 hours to do the same with Golang channels. I got 20 000 inserts per second f
by vegabook 11y ago
It took me a week struggling with Asyncio to wrap my mind around it. It took me 12 hours to do the same with Golang channels.
I got 20 000 inserts per second from a 360 gig JSON file into Cassandra using 30 goroutines. I was maxing out at 900 in Python 3. Golang was parsing the JSON at a frankly RIDICULOUS 2 million lines per second. Python 3 was around 50 thousand.
Python 3 is adding features that other languages do better. Python smashes other languages in numerics, and approachability. Nobody needs 3 for numerics, and 3 goes backwards in approachability. If you're using 3 for its back-end tools, you're using the wrong tool.
I would never move to golang for numerics because pandas/numpy/scipy/theano stomp all over it, but its only for numerics that I'll stay with Python. Everything else I'm moving away (mostly Golang, looking at Elixir) and talking to the numeric stack over zeroMQ/msgpack.
- orf 11y ago> 20 000 inserts per second from a 360 gig JSON file into Cassandra using 30 goroutines. I was maxing out at 900 in Python 3. Golang was parsing the JSON at a frankly RIDICULOUS 2 million lines per second. Python 3 was around 50 thousand. Newsflash, Go is fast. I'm sure those numbers will be worse in Py2 than Py3 as well, but aside from that what's your point? Python is slow so... don't switch to Python 3? > Python 3 is adding features that other languages do better. Python smashes other languages in numerics, and approachability. Nobody needs 3 for numerics, and 3 goes backwards in approachability. If you're using 3 for its back-end tools, you're using the wrong tool. Sure, people using it for numerical stuff might like Py2, but is that the only use case of Python? Should I not switch because you do numerical stuff? Django is great for backend stuff, as is the whole ecosystem (twisted, flask, DRF, asyncio). Python 3 is also far more approachable than Python 2. Try explaining to someone why their program exploded after typing an umlaut into it, the magical "from __future__ import division" incantation or even the silly super() syntax.
- vegabook 11y agoNewsflash. Python 3's main pragmatic selling points are Unicode and Async. Golang is Unicode by default, its concurrency model is much easier to reason about, and it's 20x faster. Why on earth would you use Python 3 (or 2) for your backend? You like buying 20 server boxes when 1 golang box will do? If you think Python will survive as a production language on servers, you're dreaming. It's done, defeated, history on the server outside of legacy code. Django? gimmeabreak. So what's left that Python does better than any other language? Numerics. That's the only place where you still have a sticky user base that is not likely to dump Python. So don't be so quick do dismiss it. It's the only leg Python is left standing on that other languages cannot easily devour. Approachability. Not much in it. For every 3/2 = 1 you cite I give you unintuitive lazy ranges, the complete idiocy that 01 != 1, and the unnecessary print functionization which removes one of Python's greatest first-line simplicity selling points. But I will give you that Python 3 remains approachable as a first language. However on that front, inroads every day from JS, where a new coder can get "wow" results in the browser much more quickly than the boring ol' VT100 terminal.
- Nrpf 11y agoJulia has multithreading and channels. Better syntax than go, more like python. Better for numerics...why use anything else?