[Python-Dev] CPython optimization: storing reference counters outside of objects

Nick Coghlan ncoghlan at gmail.com
Tue May 24 16:33:07 CEST 2011

On Tue, May 24, 2011 at 10:05 PM, Stefan Behnel <stefan_ml at behnel.de> wrote:
> Maciej Fijalkowski, 24.05.2011 13:31:
>> CPython was not designed for CPU cache usage as far as I'm aware.
> That's a pretty bold statement to make on this list. Even if it wasn't
> originally "designed" for (efficient?) CPU cache usage, it's certainly been
> around for long enough to have received numerous performance tweaks in that
> regard.

As a statement of Guido's original intent, I'd side with Maciej (Guido
has made it pretty clear that he subscribes to the "first, make it
work, and only worry about making it faster if that first approach
isn't good enough" school of thought). Various *parts* of CPython, on
the other hand, have indeed been optimised over the years to be quite
aware of potential low level CPU and RAM effects (e.g. dicts, sorting,
the small object allocator).


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-Dev mailing list