python is a language explicitly designed to resist any form of proper optimization. It just can’t be made fast
it doubled in speed from 3.9 to now, so it’s getting there.
That ignores just how slow it is. It’s on the order of 100x slower than “fast” languages like Rust and Go, so doubling in speed… while nice for Python Devs doesn’t really make it fast on an absolute scale. They need to double it’s speed a few more times at least.
go is also not a fast language. it’s about halfway between python and c.
but they all solve different problems so that’s ok.
Absolute rubbish. Go is typically something like 2-3x slower than “native” languages like C and Rust. Python is typically 50-100x times slower. Go is much much closed to C than it is to Python.
not exactly: https://benchmarksgame-team.pages.debian.net/benchmarksgame/box-plot-summary-charts.html tl;dr it can be true, but not necessarily. fast python code is on the magnitude of 1/5th the speed of go.
the thing with python is that there is a huge difference between fast and slow code. in go, only really slow code is slow, and in rust even slow code is fast.
You shouldn’t blindly trust those numbers. If you actually read the Python code a lot of them use
ctypes
to just delegate the work to C. It even says that at the bottom of the page.Seems like they’ve finally started calling these out - search for “contentious” on this page:
https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/python3-go.html
i mean, that’s what you’re supposed to do. python is a glue language, after all.
Please don’t show a close-up image of a snake, or at least add a spoiler! It’s irrelevant to the topic, and it just sets some of us on edge for no good reason. If it’s small, it’s fine, but this… holy shit, now I have a headache. It’s one of the reasons I stopped coding in Python altogether.
But looms at his little puppy dog face. :3
lol I get it, but it’s involuntary. I really wish I could like snakes but I don’t think it’s happening anytime soon.
Python typing system is the reason of its huge flexibility, but as many other scripting language, it’s also what makes it so hard to optimize.
I have no idea how you can change that without bringing some “JIT-oriented” features inside the Python language itself.
I still hope for the best, but I’m unsure we will be able to see an efficient JIT system inside CPython soon.
PyPy had to rewrite the whole Python implementation in a JIT focused way, and even with that, they are (not uncommon) cases when PyPy is slower.
I gather that you don’t actually use PyPy much. On average, I expect PyPy to deliver over a 3x speedup. The main issue is that people have built upon slow libraries like Numpy that only seem fast because CPython is even slower.
The reason that CPython cannot have a JIT added on is architectural and political. The CPython core team refuses to learn lessons from PyPy.
I’m a fan of type infrence languages
i’m a fan of ladies with complete test coverage
but i’m ok with those who are a fan of type inference.
More ladies for me
This is not entirely fair because the comparison point has changed. CPython is getting much faster, too, thanks to the optimizations stages before the JIT runs.
Microsoft cancelled its support for the Faster CPython project in May this year, as part of a round of layoffs
wtf did they actually axe Guido? I thought he was heavily involved in that.
His website still says he works for Microsoft, though it’s possible he hasn’t updated it yet.