Python Free-Threading in 3.15: When No-GIL Python Pays Off
We benchmarked Python 3.15's free-threaded build against the regular one: 7.2x faster CPU-bound threads, a 4% single-thread cost, 15% more memory, and the imports and races that undo it.

A Python service spends most of its day waiting on databases and HTTP calls, and then a CPU-heavy job arrives: building a pricing table for 40,000 SKUs, rendering a batch of PDFs, scoring orders for fraud. You hand it to a ThreadPoolExecutor with eight workers, and the server sits at one busy core while the other seven idle. The global interpreter lock (GIL) lets only one thread run Python bytecode at a time, so the usual answer has been multiprocessing, with its pickling, extra memory and awkward shared state.
Python free-threading changes that. Since Python 3.14 the free-threaded build, the one without a GIL, is officially supported, and Python 3.15 (released 9 October 2026) added a stable ABI for it. The question for a team running Django, FastAPI or background workers is no longer whether it works, but whether it pays off for your code and which parts of your stack it breaks. We ran a small lab on Python 3.15.2 to find out, and this guide walks through the numbers, the failure modes we hit and a rollout plan.
What free-threaded Python is in late 2026
PEP 703 made the GIL optional and planned three phases: experimental (3.13), supported but optional, and finally default. PEP 779 set the bar for phase II: performance within about 15% of the regular build, memory overhead under 20%, stable APIs. The Steering Council accepted it in June 2025 and removed the "experimental" label for 3.14. No decision has been made yet about making free-threading the default.
In practice that means:
- The free-threaded interpreter is a separate build, usually installed as
python3.15t. Your regularpython3.15still has a GIL. - C extensions must be compiled for it (wheel tag
cp315t), and they must declare they are safe without the GIL. If an extension does not declare this, CPython turns the GIL back on when it is imported and prints a warning. - Python 3.15 adds
abi3t, a stable ABI for free-threaded builds, so library authors can ship one wheel that covers future versions (What's new in Python 3.15). It also addssys.abi_infoand thread-safe iterator helpers inthreading, and the official macOS installer now installs free-threading support by default. - The Python docs put the single-threaded overhead at about 1% on macOS aarch64 up to 8% on x86-64 Linux on the pyperformance suite (free-threading HOWTO).
Install it and check what you are running
With uv you can install both builds side by side and create a virtual environment on the free-threaded one:
uv python install 3.15 3.15t
uv venv -p 3.15t .venv-ftThere are two separate questions: was this interpreter built without a GIL, and is the GIL actually off right now? An imported extension or the PYTHON_GIL environment variable can change the second answer at runtime.
import sys, sysconfig
built_free_threaded = sysconfig.get_config_var("Py_GIL_DISABLED") == 1
gil_on_now = sys._is_gil_enabled()
print(built_free_threaded, gil_on_now, sys.abi_info.free_threaded) # 3.15+Log both values at startup in every service you move to the free-threaded build. If gil_on_now is True on a free-threaded build, an import turned the GIL back on, and your threads are running one at a time again.
Our lab: the same workload on both builds
We used the uv-provided CPython 3.15.2 builds, regular and free-threaded, on an 8-vCPU Linux VM (Intel Xeon). The workload is pure Python, the kind of code that never releases the GIL: 48 tasks that each compute 60,000 shipping quotes using integer math, f-string zone keys, dict lookups and rounding. We ran it serially, in thread pools of 1, 2, 4 and 8 workers, in a process pool, and in the new InterpreterPoolExecutor (subinterpreters, added in 3.14). Every parallel run was checked against the serial result. Each script ran three times and the figures below are medians. Most measurements varied by less than 10% between runs, and the process pool by up to about 20%, so treat small gaps as noise.

Threads finally scale on CPU-bound code
On the regular build, more threads made things slightly worse: 1.46 s with one thread and 1.61 s with eight, because threads take turns holding the GIL. On the free-threaded build the same code took 1.59 s, 0.80 s, 0.42 s and 0.22 s with 1, 2, 4 and 8 threads. That is close to linear, and 7.2× faster than eight threads on the GIL build. We changed nothing in the code.
The single-thread tax is real but small
Serial execution took 1.52 s on the free-threaded build against 1.46 s on the regular one, about 4% slower. A one-worker thread pool was about 9% slower. That fits the 8% the Python docs give for x86-64 Linux. If your service never runs Python code in parallel, free-threading only costs you.
Processes are still competitive, and subinterpreters surprised us
A pool of 8 processes finished in 0.28 s on the regular build and 0.25 s on the free-threaded one, so for our task sizes threads and processes were within run-to-run noise of each other. The real difference is what you have to pass around. Our tasks took a small integer and returned a float. Processes have to pickle every argument and result and keep a separate copy of every module. Threads share memory, so large in-memory catalogs, caches and ML models do not have to be copied or serialized.
InterpreterPoolExecutor took 0.30 s on the regular build but 0.51 s on the free-threaded build in all three runs. We did not dig into the cause. If you plan to combine subinterpreters with the free-threaded build, measure your own workload first.
Memory goes up
Building 500,000 small order dicts used 156 MB above baseline on the regular build and 180 MB on the free-threaded one, about 15% more. The HOWTO explains the main causes: larger headers on non-GC objects, all interned strings being immortal, and deferred freeing under the QSBR reclamation scheme. Size containers for this before you switch.
Hazard 1: an import can turn the GIL back on
The biggest practical risk is quiet. We installed a typical backend stack on 3.15t using binary wheels only, then imported each package in a fresh process and checked sys._is_gil_enabled(). Here is what we found on 19 November 2026:
- GIL stays off: numpy 2.5.5, pandas 3.1.1, pydantic 2.14.3, Django 6.1.3, SQLAlchemy 2.1.9, cryptography 50.0.2, Pillow 13.0.0, msgspec 0.22.0, regex, MarkupSafe, ujson and uvloop.
- Installs, then re-enables the GIL: lxml 6.1.3 ships a
cp315twheel, but importinglxml.etreeprinted aRuntimeWarningand turned the GIL back on. Our 8-thread benchmark went from 0.22 s to 1.61 s just by adding that import. - No free-threaded wheel on PyPI: orjson 3.13.0, psycopg-binary 3.3.9 and grpcio 1.85.3 publish regular
cp315wheels but nocp314torcp315tones, so a binary-only install fails. Without that flag, pip or uv falls back to building from source where a source distribution exists, which needs a compiler toolchain and may still produce an extension that re-enables the GIL.
This changes week by week, so check the community trackers at py-free-threading.github.io and free-threaded wheels, and test your own lock file. You can force the GIL off with PYTHON_GIL=0 or -X gil=0; with lxml loaded, our benchmark went back to 0.24 s. But that override tells CPython to trust an extension that has not claimed to be thread-safe, so it is a debugging tool and not something to use in production.
A simple guard in CI or at application start turns a quiet slowdown into a clear failure:
import sys, sysconfig, warnings
if sysconfig.get_config_var("Py_GIL_DISABLED") == 1:
warnings.simplefilter("error", RuntimeWarning) # fail on the GIL warning
import myapp.wsgi # import everything you deploy
assert not sys._is_gil_enabled(), "an extension re-enabled the GIL"
Hazard 2: races that the GIL used to hide
The GIL never made counter += 1 atomic. It is a read, an add and a write, and a thread can be switched out between them. In practice, though, the GIL build rarely switches threads at exactly that point, so many codebases have unprotected counters and caches that have never visibly failed. We ran eight threads each incrementing a shared attribute 200,000 times:
- Regular 3.15 build: 1,600,000 of 1,600,000 in all three runs. That is luck, not a guarantee.
- Free-threaded build: about 320,000 in each run. Roughly 1.27 million increments, or 79%, were lost.
Built-in containers are safer than that. Eight threads appending 200,000 items each to one list produced exactly 1,600,000 items on both builds, because list, dict and set use internal per-object locks on the free-threaded build. The Python docs still recommend explicit threading.Lock over relying on those internals, and compound operations such as check-then-set are not atomic on either build.
Generators are a less obvious trap. When eight threads pulled from one shared generator, seven of them died with ValueError: generator already executing in all three runs on the free-threaded build, and the eighth consumed everything. On the regular build we saw no errors. Python 3.15 adds helpers for this in the threading module:
import threading
@threading.synchronized_iterator # each generator instance is serialized
def order_ids(batch):
for row in batch:
yield row.id
# or wrap an existing iterator:
safe_it = threading.serialize_iterator(iter(rows))Both fixes gave zero errors and all 200,000 items exactly once. Two smaller behavior changes are worth knowing. On the free-threaded build, new threads start with a copy of the caller's context variables (thread_inherit_context), and warnings.catch_warnings is context-aware by default. Code that reads request IDs or tenant IDs from contextvars in worker threads may see values it did not see before.
Hazard 3: contention can be worse than the GIL
Removing the GIL does not remove serialization when all threads fight over one lock. We had eight threads update counters in a single shared dict, guarded by one threading.Lock. That took 0.12 s on the regular build and 1.63 s on the free-threaded build, about 13× slower. With truly parallel threads, every acquire is contested across cores.
The same work with a private dict per thread, merged at the end, took 0.06 s on the regular build and 0.02 s on the free-threaded one. The design rule is the one you would use in Go or Java: give each thread its own data, communicate through queues or return values, and merge results once. Shared caches and metrics registries are the usual places this shows up.
Where it fits in a Django or SaaS stack
Most web request handling is I/O-bound, and the GIL is already released while a thread waits on the database or the network. Moving a typical Django or FastAPI app to the free-threaded build will mostly show the single-thread tax and the memory increase. The gains appear where Python code itself is the bottleneck and the work can be split:
- Batch jobs that compute prices, allocations, rate tables or reports over large in-memory datasets.
- Workers that would otherwise use many processes only to get around the GIL, especially when each process loads the same large model or catalog.
- Pipelines that mix pure-Python transformation with C libraries like numpy, where threads can now overlap both.
If you already run CPU-heavy jobs on Celery or another queue (see our guides on Celery and Redis for Django and the Django Tasks framework), a thread-based worker pool on the free-threaded build is worth benchmarking against your current prefork setup. For containers, the interpreter is a separate build, so your image needs python3.15t installed explicitly. The multi-stage approach in our Django Docker production guide works the same way with uv.
asyncio is a separate case. A single event loop runs on one thread, so free-threading does not make one loop faster. It helps when you push CPU work to threads with asyncio.to_thread() or run several loops in different threads.
A rollout plan that limits risk
- Profile first. Confirm the bottleneck is Python bytecode on the CPU, not I/O, the database or a C library that already releases the GIL.
- Audit the lock file. Install with binary wheels only on
3.15t, then run the import guard above. Replace or isolate packages that have no wheel or re-enable the GIL. - Hunt shared mutable state. Look for module-level counters, caches, singletons, lazy initialization and generators shared between threads. Add locks or give each thread its own state.
- Stress-test with real threads. Run your test suite with many threads on the free-threaded build. The races above stayed hidden on the GIL build.
- Benchmark against processes. Compare threads on 3.15t with a process pool on the regular build, on your real workload, including memory.
- Ship one worker type first. Move a single CPU-heavy job queue, log
sys._is_gil_enabled()on startup, and keep the regular build as an instant rollback.
FAQ
Is the GIL removed in Python 3.15?
No. The default build still has a GIL. The free-threaded build is a separate, officially supported interpreter you opt into, usually named python3.15t.
Will free-threading become the default?
Not decided. PEP 779 explicitly leaves phase III, the default switch, to a future PEP that depends on community adoption and clear benefits.
Should my Django app switch now?
Only if you have measured CPU-bound Python work that can run in parallel, and your dependencies keep the GIL off. For request handling that mostly waits on I/O, the regular build is still the safer default.
Is free-threading faster than multiprocessing?
For our small tasks the two were within run-to-run noise. The bigger wins are lower memory, because modules and data are not duplicated, and no pickling of large arguments. Measure with your own data sizes.
If you are weighing free-threaded Python for a CPU-heavy service, CodeSapient can audit your dependencies, find the shared-state races and benchmark threads against your current worker setup. See our development services or contact us to talk it through.
