~/talk

PEP 683: Immortal Objects - A new approach for memory managing

Talkat PyCon US 2024 · 2024-05-15..05-23· [python]
links:none on file
slides:none on file

PEP 683 marks common runtime constants as Immortal objects by setting their refcount to a sentinel and making INCREF/DECREF no-ops for them. Concrete results: reduced memory growth under heavy request loads and higher shared memory in pre-fork setups (Instagram measurements), with about a 2% CPU cost in some hotspots. Examples made immortal: None True False empty string and small ints −5..256. Work required: C‑level changes, cross‑platform compatibility, risk of accidental immortality and tradeoffs for copy‑on‑write and GIL‑related designs.

AI-written summary · about

  1. 0:00PEP 683 Immortal Objects intro
  2. 1:24Python memory basics
  3. 5:21Reference counting in threads
  4. 6:44PEP 683 goals
  5. 9:33CPU cache invalidation
  6. 10:57Copy-on-write issues
  7. 13:04Immortal objects explained
  8. 13:45Immortal objects implementation
  9. 15:55Performance impact of immortal objects
  10. 16:37Immortal objects risks
  11. 17:41Compatibility and trade-offs
  12. 18:45Future PEPs and apps
  13. 21:13PEP 703 GIL optional
  14. 23:01Q&A thread safety
~/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.