38 ms·
CPython has always strived to be a simple easy-to-read reference implementation of Python. They have rejected many patches over the decades which would have spe
by myWindoonn 8y ago
CPython has always strived to be a simple easy-to-read reference implementation of Python. They have rejected many patches over the decades which would have sped up various things at the expense of readability.
People should not use CPython for speed; they should use PyPy for speed.
- neuland 8y agoThe article did mention that Instagram's code wasn't much faster on PyPy. I agree with you though; one of the interesting and good things about Python is that it's a standard not an implementation. Although CPython is the the most popular by usage, PyPy and Cython are mainstream alternatives (or superset in the case of cython). There's also Jython, IronPython, Unladen Swallow, Grumpy, and others that I can't think of now. Some of those are defunct and others only are Python 2. But the point is, competition is good.
- eximius 8y agoAnd it is simple. I haven't written C since college and it's mostly very readable, really great for exploration. In many ways, I agree that should be kept. But memoizing lookups can be a single branch at the top of a few functions. We should strive to have our cake and eat it too, not simply declare we shouldn't bother.
- xapata 8y agoIt ain't that easy (cache invalidation is hard). But they did it anyway, so, yeah, you can have your cake and eat it.
- carapace 8y agoYes, or Cython or Nuitka. And keep an eye on the (poorly named) Grumpy project (Python compiled to Go.) http://cython.org/ http://cython.org/ https://nuitka.net/ https://nuitka.net/ https://github.com/google/grumpy https://github.com/google/grumpy