~/talk

Why Python Loops Are "Slow": A Gentle Introduction to Interpretation, Bytecode, and Fast Code

Talkat PyOhio 2025 · 2025-07-26..07-27· [python, web-performance]
links:none on file
slides:none on file

Explains why Python loop overhead comes from dynamic typing, per‑iteration interpretation, and poor branch prediction, using a Mac M1 benchmark: a naive Python loop takes 109 seconds versus NumPy 3.4s, Numba 4.1s, and Polars 15s. Shows how NumPy uses static dtypes and SIMD, Numba JITs to LLVM and auto‑vectorizes, and Polars compiles to Rust with columnar vectorized execution, so actual speedups come from static typing, vectorization, and CPU‑level optimizations.

AI-written summary · about

  1. 0:00Introduction
  2. 2:59When code is too slow
  3. 4:04How computers process code
  4. 6:35Python’s execution process
  5. 9:22Reasons loops are slow
  6. 13:15Python vs optimized tools
  7. 14:45NumPy for performance
  8. 16:51Numba JIT compilation
  9. 20:01Polars for processing
  10. 23:11Performance vs readability
  11. 25:15Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 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
?
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.