This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Fix for int(string, base) wrong answers
Type: Stage:
Components: Interpreter Core Versions:
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: Rhamphoryncus, georg.brandl
Priority: normal Keywords: patch

Created on 2005-10-22 16:44 by Rhamphoryncus, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
python-mystrtoul.diff Rhamphoryncus, 2005-10-22 16:44
python-mystrtoul-2.diff Rhamphoryncus, 2005-10-22 20:00
Messages (3)
msg48884 - (view) Author: Adam Olsen (Rhamphoryncus) Date: 2005-10-22 16:44
Fix for Bug #1334662.  Passes make test (other than
skipped tests), as well as the errors listed in Bug
#1334662.

Although it does remove the division from the loop this
does not seem to make a signifigant speedup.  No clue why.
msg48885 - (view) Author: Adam Olsen (Rhamphoryncus) Date: 2005-10-22 20:00
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.
msg48886 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-02-19 12:52
Logged In: YES 
user_id=1188172

Superseded by patch #1335972.
History
Date User Action Args
2022-04-11 14:56:13adminsetgithub: 42510
2005-10-22 16:44:18Rhamphoryncuscreate