Serhiy Storchaka added the comment: fastint2.patch adds small regression for string multiplication:
$ ./python -m timeit -s "x = 'x'" -- "x*2; x*2; x*2; x*2; x*2; x*2; x*2; x*2; x*2; x*2; " Unpatched: 1.46 usec per loop Patched: 1.54 usec per loop Here is an alternative patch. It just uses existing specialized functions for integers: long_add, long_sub and long_mul. It doesn't add regression for above example with string multiplication, and it looks faster than fastint2.patch for integer multiplication. $ ./python -m timeit -s "x = 12345" -- "x*2; x*2; x*2; x*2; x*2; x*2; x*2; x*2; x*2; x*2; " Unpatched: 0.887 usec per loop fastint2.patch: 0.841 usec per loop fastint_alt.patch: 0.804 usec per loop ---------- Added file: http://bugs.python.org/file41801/fastint_alt.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21955> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com