~/talk

Memoirs of a Python Object: Memory Management and Improving Performance

Talkat PyCon Israel 2022 · 2022-06-28..06-29· [python, web-performance]
links:none on file
slides:none on file

Shows that CPython objects are C structs (the PyObject struct) with a reference count and type info, and that reference counting plus a generational tracing GC causes full-process pauses — graphs show collections over 2 seconds. Practical fixes: use slots to shrink instance size (example: ~60% reduction), move hot code into C via Cython (example: 15x CPU and memory speedup), and preserve copy‑on‑write by using gc.freeze before forking (Instagram raised capacity ~10% after applying this).

AI-written summary · about

  1. 0:00Introduction to Python memory
  2. 2:19Python objects and memory
  3. 5:22Reference counting
  4. 8:25Garbage collection algorithms
  5. 11:31Generational garbage collection
  6. 13:24Memory optimization techniques
  7. 15:32C extensions for performance
  8. 16:43Instagram case study: GC Freeze
  9. 21:53Conclusion
~/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.