-
Notifications
You must be signed in to change notification settings - Fork 526
Open
Labels
Description
Now that free-threading (aka no-GIL) is a thing in Python 3.14, it could be interesting to explore if we can migrate to that. Not sure what kind of performance gain we could get, but it's worth to check.
The main blockers right now are libraries with C extensions that have not been adapted yet to this new mode.
Dependency blockers
sqlalchemy(ready, to release in 2.1): Implement support for free-threaded Python sqlalchemy/sqlalchemy#12881- but... asyncio features rely on
greenlet, which doesn't seem to aim at supporting free-threading: Prevent greenlet from building on free-threaded Python python-greenlet/greenlet#423
- but... asyncio features rely on
asyncpg: Add Python 3.14 support, experimental subinterpreter/freethreading support MagicStack/asyncpg#1279httptools(dependency of Uvicorn): Support for free-threaded Python MagicStack/httptools#118
Experiments
2025-10-18
Tried to run the API with:
env PYTHON_GIL=0to avoidgreenletwarning- Installed
asyncpgfrom Add Python 3.14 support, experimental subinterpreter/freethreading support MagicStack/asyncpg#1279 --http h11option of Uvicorn to avoid 3
Server is starting, can serve a few requests, but then blocks and doesn't answer new requests. Probably a concurrency problem with greenlet.