Serhiy Storchaka added the comment:

It optimizes the same cases as bpo-31410. bpo-31410 removed a half of the 
overhead for wrapper descriptors, Victor's patch removes the remaining half. 
Actually it makes calling the descriptor faster than calling the corresponding 
builtin! But bpo-31410 changes were simple, just few lines, and PR 3685 looks 
much more complex.

Are non-fast wrappers still needed? If the patch replaces the code instead of 
adding it this would decrease its cost. AFAIK the only descriptors that should 
support non-fast calling convention are __new__, __init__ and __call__.

As for practicality, this change should slightly speed up the code that 
directly calls __eq__, __lt__. For example classes decorated with 
total_ordering. Victor, can you provide microbenchmarks with more practical 
code?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31543>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to