[issue42911] Addition chains for pow saves 10 % time!

Jurjen N.E. Bos report at bugs.python.org
Fri Jan 15 11:30:36 EST 2021


Jurjen N.E. Bos <jneb at users.sourceforge.net> added the comment:

Well, measurements show that it saves more time than I thought (sometimes over 20%!), because there are other ways in which it saves time; I am quite happy with that.

In the code I needed functions _Py_bit_length64 and _Py_bit_count64.
I thought these could better move to the bitutils, but I am not sure about a good name to use, since there are probably other places where these are used, too (I know of at least one in hashtable.c).
The 32 bits versions in bitutils are called _Py_bit_length and _Py_popcount32 (not the most logical names).
So then it would also be more logical to give all four of these consistent names, everywhere. But that's probably better at a later time, right?

----------

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


More information about the Python-bugs-list mailing list