Skip to content
Opensource internals
  • Posts

Performance

CPython Interns Strings

Jan 22, 2026 6 min read Jay Hubbert

CPython keeps a global table of immortal static strings and a per-interpreter dict of mortal runtime ones, so equal strings can be compared by pointer.

PythonCpythonInternalsPerformanceStrings

Read more →

CPython's pymalloc: Arenas, Pools, and Size Classes for Small Objects

Nov 11, 2025 7 min read Jay Hubbert

CPython’s pymalloc hands out objects up to 512 bytes from a free list inside a size-class pool, so the fast path is one array lookup, one comparison, and one pop.

PythonCpythonInternalsMemoryPerformance

Read more →

CPython Specializes Bytecode with Inline Caches: The Adaptive Interpreter

Aug 5, 2025 6 min read Jay Hubbert

Hot bytecode gets rewritten in place behind a version-tag guard: when the type or dict changes, the tag moves and the interpreter falls back to the generic path.

PythonCpythonInternalsPerformanceBytecode

Read more →

← Newer Page 23 of 23 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·