BRC's Performance Impact: Multi-Core Gains vs. Single-Thread Cost

While free-threaded Python (via PEP 703) enables true parallel execution for CPU-bound multi-threaded tasks, potentially offering 2x-4x speedups, it introduces a single-threaded performance penalty. Initially, this penalty was around 40% in experimental Python 3.13 builds, but has been significantly reduced to roughly 5-10% in Python 3.14 due to optimizations like the specializing adaptive interpreter.

The top 3

  1. Multi-Core Gains: Up to 8x Speedup for CPU-Bound Tasks: With PEP 703's optional GIL removal, Python 3.14 has shown significant multi-core performance improvements, with benchmarks demonstrating up to a 3.9x speedup on 4 threads for CPU-bound tasks, and some FastAPI CPU-bound endpoints even achieved an ~8x increase in throughput.
  2. Single-Thread Cost: Up to 15% Slower in No-GIL Builds: While multi-core performance soars, free-threaded CPython (without the GIL) is expected to run roughly 10-15% slower on single-threaded workloads compared to GIL-enabled builds. Early Python 3.13 experimental builds showed an initial ~40% penalty, projected to decrease to ~10% in later releases like 3.14.
  3. BRC Overhead: The Root of Single-Thread Performance Dip: The single-thread performance cost in no-GIL Python stems from the necessary transition to thread-safe memory management, primarily Biased Reference Counting (BRC). This new mechanism, along with other synchronization, introduces overhead for reference counting operations that the GIL previously allowed CPython to bypass.

Sources

Open the full topic