Antoine Pitrou <pit...@free.fr> added the comment: 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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32346> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com