Python 3.13's new JIT and no-GIL modes

  Рет қаралды 4,937

InfoWorld

InfoWorld

Күн бұрын

Пікірлер: 11
@sdmagic
@sdmagic 8 ай бұрын
Very nicely done.
@OmarHashimOAD
@OmarHashimOAD 8 ай бұрын
I enjoy your content; keep up the great work!
@rafael86ny
@rafael86ny 5 ай бұрын
Wonderful content!
@felixfourcolor
@felixfourcolor 7 ай бұрын
I believe Fedora 41 will ship Python with the JIT, but disabled by default (can be turned on via command line argument). I don't think any distro will ship free-threading though.
@InfoWorld
@InfoWorld 7 ай бұрын
That's useful to know. 3.13 beta 2 is shipping with an experimental version of free-threading enabled for Mac users during the installation process, but so far that's the only precompiled version being shipped by Python.org right now. For the time being the rest of us will have to compiled it by hand. -Serdar
@alexandermorgan5869
@alexandermorgan5869 7 ай бұрын
Great video! Are there any instructions on how to build these two different versions of python 3.13?
@InfoWorld
@InfoWorld 7 ай бұрын
I actually have plans for a future video where I demonstrate the compilation process on Windows! Stay tuned. -Serdar
@timmurphy5541
@timmurphy5541 3 ай бұрын
multiprocessing has advantages because a crash in one process cannot affect the other. Perhaps we're not accustomed to crashes in python but I don't think it's impossible when you're using C modules. Personally I think it's also imaginable that we could turn it into a multi-computer mechanism without any structural change.
@teawithoutdonuts31
@teawithoutdonuts31 7 ай бұрын
The question I eant answered is how will this affect ASGI and WSGI web frameworks.
@benshapiro9731
@benshapiro9731 7 ай бұрын
My best guess based on experience with FastAPI: the way fast api runs its route handler funcs is if the func is a coroutine (async def) and thus can pause execution during await calls, then it is run on the main thread. If it is a blocking function (def) then it is delegated to the underlying threadpoolexecutor via something like asyncio.to-thread. In my experience, a lot of production code uses just normal functions as opposed to Coroutines for the route handlers due to the relatively recent introduction of async mechanics into the language. If running the no Gil python really has no effect on single threaded code, then at worst this change will have no effect and at best it will give asgi frameworks that work similarly to fastapi a huge speed boost (since those blocking route handler funcs can be executed truly in parallel via the thread pool executor). As far as I know the current best practice is to put non blocking io into async functions and cpu bound tasks into regular functions. Even though Asyncio event loop executes coroutines on the same thread as the event loop, the fact that coroutines are a much lower cost abstraction than threads means that this execution model is faster than using a thread pool. However, the removal of the Gil could change that if the numbers and benchmarks start telling a different story. This may necessitate some internal changes to various asgi frameworks to delegate more coroutines to thread pools as opposed to running them on the main thread. But if your route handler funcs are just regular functions, then out of the box this should yield a major speed increase.
@jaimel8219
@jaimel8219 6 ай бұрын
The culprit will be the 3rd party libraries partially unmaintained that most web apps depend on. GIL enabled tons of thread-unsafe code to be written.
What's New in Python 3.13?
19:02
NeuralNine
Рет қаралды 11 М.
python is removing the GIL! (PEP 703) (advanced) anthony explains #550
24:04
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН
JIT в Python | Никита Соболев | True Tech Day 2.0
34:35
How Much FASTER Is Python 3.13 Without the GIL?
10:00
ArjanCodes
Рет қаралды 187 М.
UV and Ruff: Next-gen Python Tooling
56:54
Matt Layman
Рет қаралды 7 М.
5 deadly Rust anti-patterns to avoid
13:25
Let's Get Rusty
Рет қаралды 40 М.
5 Really Cool Python Functions
19:58
Indently
Рет қаралды 70 М.
What You Need To Know About Python 3.13
15:45
Jake Callahan
Рет қаралды 11 М.
10 Important Python Concepts In 20 Minutes
18:49
Indently
Рет қаралды 478 М.
5 Useful Python Decorators (ft. Carberra)
14:34
Indently
Рет қаралды 112 М.