4 ms·
cpython is the reference implementation, so it makes sense that it's; A) Not well optimised. B) Touting features before the spec/standard. EDIT: people reall
by dijit 10y ago
cpython is the reference implementation, so it makes sense that it's;
A) Not well optimised.
B) Touting features before the spec/standard.
EDIT: people really dislike that I said this, and I'm having trouble finding my original citation- it was on one of the many python books I own. Most likely "Learn Python The Hard Way" but I'll dig out the exact chapter where they compare pypy to cpython and mention that because cpython is the reference implementation it values code clarity over performance optimisation.
- the_duke 10y agoIt makes sense that the official, primary and by far most popular implementation of one of the most used languages in existance is not well optimized? (edit: I'm just being polemic about your statement here. CPython is reasonably optimized within the constraints it currently has).
- nodja 10y agoIt only makes sense because it's python. A language where style is part of the syntax, and readability is one of the things that many libraries focus on , the so called being "pythonic". It makes sense that the reference implementation mirrors the same patterns than the language itself.
- the_duke 10y agoSomeone else already posted this link: https://www.youtube.com/watch?v=qCGofLIzX6g&list=PLRdS-n5seLRqszBqVDF342RMlCWgOTm6q&index=11 https://www.youtube.com/watch?v=qCGofLIzX6g&list=PLRdS-n5seL... It explains why CPython can't improve on many things.
- paulsmith 10y agoWho says CPython is not well-optimized? CPython is 25 years old -- people have been making it faster for a long time. Python 3.6, the latest release, has many performance improvements, cf. http://www.infoworld.com/article/3120952/application-development/hands-on-python-36s-speed-boost-matters.html http://www.infoworld.com/article/3120952/application-develop...
- trotterdylan 10y agoInterestingly, achieving performance parity with CPython is one of the biggest challenges of this project. There are certain things CPython does very fast like allocating and freeing many small objects.
- webmaven 10y agoSo, Grumpy currently isn't faster than CPython?
- deleted 10y ago[deleted]
- lima 10y agoNotably, some of the 3.6 performance improvements were merged in from PyPy :-)
- ericfrederich 10y agoPlease watch that first video, it's a good one. It explains how CPython essentially _is_ the spec because its internals leak into the spec when they have no business being there.
- dom0 10y agoPretty much the same is true about most other languages that have a single main implementation. This is even true, to some degree, for Java, which had competing implementations relatively early on.
- viraptor 10y agoAt some point it leaked pretty hard as well. The package scope was an unspecced implementation behaviour that became a standard later. (If I recall the story correctly)