Issue 1334979: Fix for int(string, base) wrong answers (original) (raw)

Logged In: YES user_id=12364

This one moves smallmax into a precomputed global table.

$ python2.4 -m timeit 'int("999999999")' 1000000 loops, best of 3: 0.863 usec per loop $ python2.4 -m timeit 'int("9")' 1000000 loops, best of 3: 0.716 usec per loop $ ./python -m timeit 'int("999999999")' 1000000 loops, best of 3: 0.766 usec per loop $ ./python -m timeit 'int("9")' 1000000 loops, best of 3: 0.694 usec per loop

So 0.863 -> 0.766 and 0.716 -> 0.694. 11% and 3%. I wouldn't bother if it weren't fixing a bug, but maybe the http://spoj.sphere.pl test will show a larger difference.