~/talk

Intuition vs. Reality: Surprising Truths in Python Performance

Talkat PyCon US 2025 · 2025-05-16..05-18· [python, web-performance]
slides:none on file

Benchmarks use py benchmark on GitHub runners and a released performance lab called cut speed and measure time and peak memory via trace maloc; concrete results: len(listcomp) is fastest for counting evens but it peaks around 4 MB vs a few hundred bytes for generator/sum, showing a speed–memory tradeoff. Rewriting in Rust via rest import sometimes slows tiny functions because Python→Rust conversion costs dominate, in one case Rust is ~10× faster for compute‑heavy work; using pyo3 types to avoid full copies makes native code win.

AI-written summary · about

  1. 0:00Performance intuition vs reality
  2. 2:27Python performance matters
  3. 7:47Counting even numbers
  4. 14:00String concatenation
  5. 17:38List comp vs map
  6. 21:56Recursive vs stack factorial
  7. 25:12Python rewritten in Rust
  8. 35:48Leaderboard results
  9. 36:31Key takeaways
~/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.