High-Performance Python: Faster Type Checking and Free Threaded Execution
summary
Free-threaded Python ships as an optional build since 3.13 and shows real results: 3.14 restores single-thread speed to within ~8% of GIL builds while enabling parallel threads. The port uses biased reference counting plus deferred reference counting, per-instance locks and a Python critical sections API to keep single-thread performance high and avoid deadlocks. Pyrefly is a Rust-based, module-parallel type checker that hits ~1.8M lines/sec and reports being ~35× faster than Pyre1 and ~14× faster than Pyright/MyPy.
AI-written summary · about
chapters (23)
- 0:00Free threaded Python intro
- 2:06Free threading multi-core gains
- 3:52Free threading history and future
- 8:46Reference counting challenges
- 10:09Thread-safe collections with locks
- 11:54Python 3.13/3.14 free threading
- 14:43Future plans for Python 3.15 and beyond
- 15:48How to use free threaded Python today
- 16:53Q&A on free threading
- 23:18PyreFly type checker intro
- 26:26Installing PyreFly
- 27:30Pyre to PyreFly at Meta
- 31:40PyreFly's four features
- 34:51Type inference and IDE support
- 37:21Why PyreFly is open source
- 39:05Type checking benefits
- 42:32PyreFly design and phases
- 48:52PyreFly team and resources
- 51:00Q&A on type checking
- 54:06Type checker comparisons
- 1:00:03Python type checking future
- 1:01:04Convincing Meta to open source
- 1:02:29Q&A on errors and runtime types
related talks
29mGoodbye GIL: Exploring the Free-threaded mode in Python
34mMaking Python Faster with Free Threading and Mypyc
39mUnlocking the Parallel Universe: Subinterpreters and Free-Threading in...
30mFree threaded Python past, present and future
22mPyPy and the future of the Python ecosystem
42mThe state of PyPy
22mPyPy in production
26mPython Performance at Scale - Making Python Faster at Instagram
