Issue1102
Created on 2008-08-11.21:42:07 by leosoto, last changed 2009-10-07.02:59:54 by pjenvey.
msg3422 (view) |
Author: Leonardo Soto (leosoto) |
Date: 2008-08-11.21:42:05 |
|
Currently, almost every lookup on a new-style instance (*Derived) does
in fact two lookups: first finds the '__getattribute__' slot in the type
mro, then the actual attribute lookup takes place. And, if
__getattribute__ raises AttributeError, another mro lookup takes place,
this time for __getattr__.
This is somewhat solved on old-style instances (PyInstance), where the
__getattr__ slot is cached on PyClass. Although it has a problem: the
cache is not invalidated/refreshed when the __getattr__ slot is
dinamically changed.
|
msg3424 (view) |
Author: Leonardo Soto (leosoto) |
Date: 2008-08-11.22:20:57 |
|
We also should take into account that __bases__ can be dynamically
changed: http://bugs.python.org/issue635933
|
msg5219 (view) |
Author: Philip Jenvey (pjenvey) |
Date: 2009-10-06.02:02:06 |
|
r6161/r6210 fixed PyClass's cached __xattr__ slots not being refreshed
when changed
|
msg5223 (view) |
Author: Philip Jenvey (pjenvey) |
Date: 2009-10-07.02:59:53 |
|
r6844 / r6845 totally avoid the __getattribute__ lookup/descriptor call
by fast pathing if the type uses object.__getattribute__. This gives us
a pretty good speedup, we beat CPython on richards now, @ about .9
whereas r6843 is about 1.2/3x slower
CPython does an optimization here where it looks up the descriptor and
fast paths if it's equiv to object.__getattribute__. Our's is based off
PyPy's which is more agressive, we keeps a flag on the type to determine
whether we should fast path, so that faster path also avoids the
descriptor lookup
|
|
Date |
User |
Action |
Args |
2009-10-07 02:59:54 | pjenvey | set | status: open -> closed resolution: fixed messages:
+ msg5223 |
2009-10-06 03:47:34 | pjenvey | set | assignee: pjenvey |
2009-10-06 02:02:07 | pjenvey | set | nosy:
+ pjenvey messages:
+ msg5219 |
2008-12-17 19:49:24 | fwierzbicki | set | priority: normal |
2008-08-11 22:20:58 | leosoto | set | messages:
+ msg3424 |
2008-08-11 21:42:07 | leosoto | create | |
|