[issue31543] Optimize wrapper descriptors using FASTCALL

Serhiy Storchaka report at bugs.python.org
Thu Sep 21 12:52:11 EDT 2017


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 <report at bugs.python.org>
<https://bugs.python.org/issue31543>
_______________________________________


More information about the Python-bugs-list mailing list