~/talk

Slots, slots, slots, everybody: an exploration of __slots__

Talkat PyCon Canada 2017 · 2017-11-18..11-21· [python]
links:none on file
slides:none on file

Explains that using __slots__ replaces per-instance dicts with a packed array plus descriptors, saving about 10 MB in a 100k-instance benchmark and making attribute access roughly 30% faster in a 1M-access timeit run. Demonstrates the experiments using tracemalloc for memory and timeit for speed, shows subclassing requires re-declaring slots, compares to namedtuple which is ~20% larger than slotted but ~2x slower for attribute access.

AI-written summary · about

  1. 0:00Introduction
  2. 1:07What are slots?
  3. 2:55How attribute storage works
  4. 4:18How slots work
  5. 6:49Benefits of slots
  6. 11:50Trade-offs of slots
  7. 14:01Alternatives to slots
  8. 17:52Summary and takeaways
  9. 18:38Acknowledgments and Q&A
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.