On Tue, Aug 17, 2010 at 10:05 PM, Carl Witty <[email protected]> wrote:
> On Tue, Aug 17, 2010 at 9:54 PM, Robert Bradshaw
> <[email protected]> wrote:
>> On Tue, Aug 17, 2010 at 9:41 PM, Carl Witty <[email protected]> wrote:
>>> On Tue, Aug 17, 2010 at 9:27 PM, Robert Bradshaw
>>> <[email protected]> wrote:
>>>> Yep. I confirmed that just setting creating __getattr__ does incur the
>>>> performance loss, even if __getattribute__ was good. It looks like
>>>> there's no way to have a __getattr__ python-visible attribute without
>>>> a performance penalty.
>>>
>>> Well, I think (but I'm not sure) that if the python-visible
>>> __getattr__ is an instance of PyWrapperDescr_Type, then the problem
>>> doesn't arise.
>>
>> Looking at typeobjet.c:slot_tp_getattr_hook, I'm not sure even this
>> would help, but I haven't fully unraveled the logic of
>> update_one_slot. Worth further investigation and/or a try.
>
> The goal is to keep our slot method in tp_getattro, in which case
> slot_tp_getattr_hook isn't involved at all.

Yep. If we can do that, that'd be great. Perhaps just making
__getattr__ a PyWrapperDescr_Type would be enough. I'm running on way
too few hours of sleep to attempt that now...

- Robert
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to