Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment: The relative speed up looks nice. But it is just few microseconds per class. You have to create many thousands of classes to gain a significant fraction of second. And the complexity added by this patch is not tiny.
I'm not sure how this caching works when change the parent class after creating the child class. 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 tried to simplify this change (even at the cost of smaller speedup). But the result still looks too complex. Since the benefit in any case will be small, and seems there are no other issues that depend on this change, I suggest to defer it to 3.8. There are more priority changes that should be made before the feature freeze in 3.7. ---------- _______________________________________ 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