PyPy: The FASTEST Python implementation
HTML-код
- Опубликовано: 2 окт 2024
- "If you want your code to run faster, you should probably just use PyPy."
- Guido van Rossum, 2015 ( • Type Hints - Guido va... )
I mean, who can argue with the big boss?
Resources:
• More detailed architectural discussion: doc.pypy.org/e...
• Real Python article: realpython.com...
-
If you enjoy my content, consider supporting me on Patreon or becoming a member!
patreon.carber...
join.carberra.xyz
If you need help with anything, feel free to join the Discord server:
discord.carber...
I get a lot of people asking, so here's my Visual Studio Code setup!
• My Visual Studio Code ...
-
If you have any questions, don't hesitate to ask in the comments! I'll try and answer as soon as I can, providing someone else hasn't already done so.
#python #coding #howto
I mentioned at 3:05 that PyPy can't use C-libraries. This is actually incorrect; I meant to say that they run slower in PyPy than in CPython: doc.pypy.org/en/latest/faq.html#do-c-extension-modules-work-with-pypy
Kilback Drives
Walker Union
Dietrich Station
Anderson Spring
Maxime Spur
Gideon Locks
Madie Locks
Meaghan Shoals
Horace Canyon
Pearlie Forge
Lehner Views
Keenan Hollow
The fact that it runs numpy slower than CPython makes it not very useful. I can't imagine any scenario where your python program is so computationally expensive that you need a faster alternative, but you don't already use numpy.
a game...
@@RicardoSuarezdelValle good point
Hudson Knoll
Brown Brook
Torp Crossing
there is now pypy 3.10 out
Oh nice! Sorry, thought I replied when I saw this, must've gotten distracted checking it out lmao.
3.12 actually 😅
Where? Their website only says up to 3.10.
@@Carberra I might have misunderstood the context 😅
But it's very nice that you still keep up with comments under old videos!
Which now seems dumb as OP clearly meant pypy 🙄
Any thoughts on using pyscript instead of javascript? I understand it's known to be much slower but perhaps techniques/updates have changed recently where the performance hit isn't so bad?
From what I've seen, pyodide (what it runs on) does take quite a while to load. From a performance standpoint alone it's probably not worth it. I did a video on it a little while ago if you're interested to learn more though.
great video! what's your vsc theme and icon pack?
Thank you! VS Code setup is in the description (:
Tianna Forks
great, thanks man!
Botsford Island
Can it handle Pytorch?
As far as I can tell, no.
the fastest? i wouldnt be so sure about that. Nuitka can be really fast in some cases, Taichi/Numba are technically implementations of python, which JIT compile it, Cython compiles type-annotated python to C, MyPyC also compiles mypy-checked python... and almost all of them are in some ways faster than PyPy.
The things you've mentioned there are compilers (or numerical accelerators in Numba's case), not implementations.
wiki.python.org/moin/PythonImplementations
Hi im trying to use PyPy as interpreter in jupyter notebook but I cannot install packages using "pip install package_name" or "pypy -m install package_name". Can u suggest a solution
The best solution to this and every other IT problem you have is sign up for AI helper. I pay $ 25 and $ 10 a month for BITO and Co-Pilot in VS Code and they save me 75% time by being able to almost always help when I get a problem like you describe. There are others and they are probably just as good. AI is REALLY REALLY useful with programming and IT issues.
"The FASTEST Python implementation"
Graal Python or GraalPy would disagree. GraalVM provides a Python 3.8 compliant runtime. The aim is to bring compatibility up to python 3.10.
In my very limited testing Graalpy is 2-3x slower than pypy3.10
2 min content in a 10 min video