~/talk

Out of the Frying Pan/Into the Fire -Multiprocessed code to Free Threading

Talkat PyBay 2025 · on Saturday, 2025-10-18· [python]
github:lisroach
slides:none on file

Converts multiprocessing to free-threading on an 80-core Linux server using a CPU-heavy loop (2,500 ops per iteration) and benchmarks at 5k/50k/500k tasks, finds free-threading fastest only at small scale then slower as contention and cache effects appear, shares a 2 million-integer list to reveal copy-on-write advantages for multiprocessing, observes a race that produces ~1% counter loss, and only beats multiprocessing after adding locks, using FTUtils local wrapper and atomic_int64, but notes free-threading remains experimental.

AI-written summary · about

  1. 0:00Introduction to free threading
  2. 0:50Concurrency options overview
  3. 2:36Global Interpreter Lock explained
  4. 4:02Challenges with traditional threading
  5. 5:48Multiprocessing limitations
  6. 8:19Free threading advantages
  7. 9:22Benchmark setup and machine specs
  8. 10:27CPU-bound code performance comparison
  9. 12:10Shared data read-only benchmark
  10. 14:15Shared data read-write benchmark
  11. 15:43Unbalanced workload impact
  12. 16:47Thread contention and cache issues
  13. 18:33Reference count contention
  14. 20:21Race conditions in threading
  15. 22:06Optimizing with locks
  16. 22:48FTUtils library introduction
  17. 24:35Final performance results
  18. 25:38Thread sanitizer for Python
  19. 26:43When to use free threading
  20. 27:49Q&A session
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.