~/talk

Optimizing Code Performance for Python Internals

Talkat PyCon Israel 2022 · 2022-06-28..06-29· [python, compilers-and-language-design]
links:none on file
slides:none on file

Shows concrete CPython internals that affect speed: CPython 3.10 uses a faster lookdict_unicode path for string-only dicts but inserting a non-string key or deleting a slot permanently falls back to the slower path; instance attribute key-sharing dicts (split dicts) save memory and CPU but adding attributes conditionally or deleting them disables sharing until the interpreter restarts; globals use inline caches with a 64-bit dict versioning counter (cache flushes slow code ~1.5x); CPython 3.11 gives ~1.5–1.7x speedups and 3.13 aims for ~4x.

AI-written summary · about

  1. 0:00Introduction to Python internals
  2. 4:41Dictionaries performance basics
  3. 12:53Dictionary structure deep dive
  4. 25:52Global variables and inline caches
  5. 37:48Future of CPython optimizations
  6. 40:34Key takeaways and Q&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.