Skip to content
Opensource internals
  • Posts

Python

CPython's Garbage Collector: Generational Collection at Work

Oct 16, 2026 8 min read Jay Hubbert

CPython frees most objects the instant their refcount hits zero; the cyclic GC is the safety net for reference cycles, using three generations and a gc_ref copy of the refcount.

PythonCpythonInternalsGarbage collection

Read more →

What's New in Python 3.15: Lazy Imports, frozendict, Tachyon, and More

Oct 15, 2026 7 min read Jay Hubbert

Python 3.15 makes startup cheaper, UTF-8 the default, and ships a sampling profiler you can attach to a running process.

PythonCpythonPython 3.15

Read more →

CPython's Cache of Small Integers: 1030 Immortal Objects

May 2, 2026 5 min read Jay Hubbert

Every int from -5 to 1024 is allocated once at startup and marked immortal, so a = 1; b = 1; a is b is True by construction — not by accident of the language.

PythonCpythonInternalsPerformanceIntegers

Read more →

CPython Reuses Objects with Free Lists: Recycling Dead Objects for Free

Mar 14, 2026 7 min read Jay Hubbert

Freelists turn the first word of a dead object into a linked-list pointer, so the next list, tuple, or float pops a ready-made shell instead of hitting the allocator.

PythonCpythonInternalsPerformanceMemory

Read more →

CPython Makes Python Calls Fast with Vectorcall

Mar 2, 2026 6 min read Jay Hubbert

Vectorcall replaces the per-call tuple and dict with a plain C array plus a kwnames tuple, and the ARGUMENTS_OFFSET flag makes bound methods allocation-free.

PythonCpythonInternalsPerformanceCalls

Read more →

← Newer Page 10 of 11 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·