[issue21955] ceval.c: implement fast path for integers with a single digit

Serhiy Storchaka report at bugs.python.org
Fri Feb 5 12:01:35 EST 2016


Serhiy Storchaka added the comment:

My patches were just samples. I'm glad that Yury incorporated the main idea and that this helps. If apply any patch I would prefer fastint5.patch. But I don't quite understand why it adds any gain. Is this just due to overhead of calling PyNumber_Add? Then we should test with other compilers and with the LTO option. fastint5.patch adds an overhead for type checks and increases the size of ceval loop. What is outweigh this overhead?

As for tests, it would be more honest to test data that results out of small ints range (-5..256).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21955>
_______________________________________


More information about the Python-bugs-list mailing list