[issue46020] Optimize long_pow for the common case

Ken Jin report at bugs.python.org
Thu Dec 9 08:12:12 EST 2021


Ken Jin <kenjin4096 at gmail.com> added the comment:

I'm not sure about the original 10:1 difference in 3.10, but in 3.11, the 2:1 difference might be due to the PEP 659 machinery optimizing for int * int, and float * float cases (see BINARY_OP_MULTIPLY_INT and BINARY_OP_MULTIPLY_FLOAT in ceval).

Last I recall, these were slightly faster than their unspecialized counterparts as they have less overhead in C function calls. Meanwhile, none of the power operations are optimized via PEP 659 machinery at the moment.

----------
nosy: +kj

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46020>
_______________________________________


More information about the Python-bugs-list mailing list