[Python-Dev] Non-string keys in namespace dicts

Aahz aahz at pythoncraft.com
Sun Dec 2 22:01:09 CET 2007

On Sun, Dec 02, 2007, Neil Toronto wrote:
> Anyway, report: I've got an initial working attribute cache, using the 
> conveniently-named-and-left-NULL tp_cache. It's a nice speedup - except 
> on everything the standard benchmarks test, because their class 
> hierarchies are very shallow. :p  If an MRO has more than two classes in 
> it, every kind of lookup (class method, object method, object attribute) 
> is faster. Having more than four or five makes things like self.variable 
> take less than half the time.

This patch is probably a non-starter, then: that's what killed the
CACHE_ATTR patch several years ago (I was sprinting on that with Guido
and Ping):

Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"Typing is cheap.  Thinking is expensive."  --Roy Smith

More information about the Python-Dev mailing list