This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients gvanrossum, methane, pitrou, scoder, serhiy.storchaka
Date 2018-01-11.19:46:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <d39441f3-f400-fdf7-ad31-9f6036796544@free.fr>
In-reply-to <1515698713.14.0.467229070634.issue32346@psf.upfronthosting.co.za>
Content
Le 11/01/2018 à 20:25, Serhiy Storchaka a écrit :
> 
> I'm not sure how this caching works when change the parent class after creating the child class.

The caching is invalidated at the same place the method cache is
invalidated.

> Without caching the benefit is 20-50% smaller. Perhaps this result can be improved. Actually we don't need to search in all dictionaries of all classes in the MRO. We can check the correspondent slot in the parent class (the offsets are constants) and look up in the class dict of the first class with non-zero slot value.

I'm not sure that's always true.  The relationship between class dict
attributes and tp_ slots is not 100% bijective, there's more complicated
stuff going on for some of the descriptors.  My patch keeps the current
algorithm (ensuring no descriptor gets broken) but optimizes the lookups.

> There are more priority changes that should be made before the feature freeze in 3.7.

I am not working on any of those changes, so deferring this PR will not
have any effect on those changes.
History
Date User Action Args
2018-01-11 19:46:44pitrousetrecipients: + pitrou, gvanrossum, scoder, methane, serhiy.storchaka
2018-01-11 19:46:44pitroulinkissue32346 messages
2018-01-11 19:46:44pitroucreate