Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for int(string, base) wrong answers #42510

Closed
Rhamphoryncus mannequin opened this issue Oct 22, 2005 · 3 comments
Closed

Fix for int(string, base) wrong answers #42510

Rhamphoryncus mannequin opened this issue Oct 22, 2005 · 3 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@Rhamphoryncus
Copy link
Mannequin

Rhamphoryncus mannequin commented Oct 22, 2005

BPO 1334979
Nosy @birkenfeld
Files
  • python-mystrtoul.diff
  • python-mystrtoul-2.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2006-02-19.12:52:31.000>
    created_at = <Date 2005-10-22.16:44:18.000>
    labels = ['interpreter-core']
    title = 'Fix for int(string, base) wrong answers'
    updated_at = <Date 2006-02-19.12:52:31.000>
    user = 'https://bugs.python.org/Rhamphoryncus'

    bugs.python.org fields:

    activity = <Date 2006-02-19.12:52:31.000>
    actor = 'georg.brandl'
    assignee = 'none'
    closed = True
    closed_date = None
    closer = None
    components = ['Interpreter Core']
    creation = <Date 2005-10-22.16:44:18.000>
    creator = 'Rhamphoryncus'
    dependencies = []
    files = ['6829', '6830']
    hgrepos = []
    issue_num = 1334979
    keywords = ['patch']
    message_count = 3.0
    messages = ['48884', '48885', '48886']
    nosy_count = 2.0
    nosy_names = ['georg.brandl', 'Rhamphoryncus']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1334979'
    versions = []

    @Rhamphoryncus
    Copy link
    Mannequin Author

    Rhamphoryncus mannequin commented Oct 22, 2005

    Fix for Bug bpo-1334662. Passes make test (other than
    skipped tests), as well as the errors listed in Bug
    bpo-1334662.

    Although it does remove the division from the loop this
    does not seem to make a signifigant speedup. No clue why.

    @Rhamphoryncus Rhamphoryncus mannequin closed this as completed Oct 22, 2005
    @Rhamphoryncus Rhamphoryncus mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Oct 22, 2005
    @Rhamphoryncus Rhamphoryncus mannequin closed this as completed Oct 22, 2005
    @Rhamphoryncus Rhamphoryncus mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Oct 22, 2005
    @Rhamphoryncus
    Copy link
    Mannequin Author

    Rhamphoryncus mannequin commented Oct 22, 2005

    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.

    @birkenfeld
    Copy link
    Member

    Logged In: YES
    user_id=1188172

    Superseded by patch bpo-1335972.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant