The release of Python 3.13 with experimental free-threaded mode (PEP 703) represents a fundamental shift in Python's concurrency model. For decades, the Global Interpreter Lock has dictated how we write concurrent Python code, pushing developers toward async/await patterns for I/O-bound workloads and multiprocessing for CPU-bound tasks. But what happens when we remove that constraint?
We designed a research experiment to answer this question empirically: take a production trading algorithm built on asyncio, migrate it to free threading, and measure everything. Trading systems make ideal subjects for this research—they're latency-sensitive, handle multiple concurrent data streams, perform both I/O and CPU-bound operations, and have clear, quantifiable performance metrics.
This talk presents our complete research journey, from initial hypothesis to validated conclusions, sharing both our methodology and findings.
Detailed Outline:
The research question: can a trading algorithm benefit from true parallelism? Why trading systems make ideal experimental subjects Initial hypotheses about performance characteristics Baseline system: async architecture and performance profile
Migration approach Benchmarking framework Workload simulation Control variables and isolation of I/O vs. CPU-bound operations
Architectural transformation Key refactoring patterns and synchronization strategies Thread safety challenges Library ecosystem compatibility findings
Performance data: latency, throughput, and resource utilization Workload analysis: where free threading won, where async remained competitive Visual data presentation: charts and comparative analysis
Decision framework: when to choose free threading over async Migration best practices and lessons learned Production readiness assessment What this means for Python's concurrent future
Prerequisites - This talk assumes attendees have: