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

glob.py improvements #47409

Closed
amikrop mannequin opened this issue Jun 21, 2008 · 2 comments
Closed

glob.py improvements #47409

amikrop mannequin opened this issue Jun 21, 2008 · 2 comments
Labels
performance Performance or resource usage stdlib Python modules in the Lib dir

Comments

@amikrop
Copy link
Mannequin

amikrop mannequin commented Jun 21, 2008

BPO 3159
Nosy @facundobatista, @amikrop
Files
  • glob.py.patch: The patch in "diff -urN" format.
  • 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 2008-07-11.02:43:59.815>
    created_at = <Date 2008-06-21.09:51:15.882>
    labels = ['library', 'performance']
    title = 'glob.py improvements'
    updated_at = <Date 2008-07-11.02:43:59.760>
    user = 'https://github.com/amikrop'

    bugs.python.org fields:

    activity = <Date 2008-07-11.02:43:59.760>
    actor = 'facundobatista'
    assignee = 'none'
    closed = True
    closed_date = <Date 2008-07-11.02:43:59.815>
    closer = 'facundobatista'
    components = ['Library (Lib)']
    creation = <Date 2008-06-21.09:51:15.882>
    creator = 'Indy'
    dependencies = []
    files = ['10680']
    hgrepos = []
    issue_num = 3159
    keywords = ['patch']
    message_count = 2.0
    messages = ['68493', '69529']
    nosy_count = 2.0
    nosy_names = ['facundobatista', 'Indy']
    pr_nums = []
    priority = 'normal'
    resolution = 'rejected'
    stage = None
    status = 'closed'
    superseder = None
    type = 'performance'
    url = 'https://bugs.python.org/issue3159'
    versions = ['Python 2.5']

    @amikrop
    Copy link
    Mannequin Author

    amikrop mannequin commented Jun 21, 2008

    Simplified some of the code, improving performance and readability.

    @amikrop amikrop mannequin added stdlib Python modules in the Lib dir performance Performance or resource usage labels Jun 21, 2008
    @facundobatista
    Copy link
    Member

    If readability is enhanced is questionable, but is rejected on the basis
    that cosmetic-only changes are not generally recommended: only
    difficults following the code evolution in the repository.

    The only change that I see regarding performance is the one involving
    startswith, and it's actually wrong:

    facundo@pomcat:$ timeit.py -s "s='qwerty'" "s[0]=='q';s[0]=='x'"
    1000000 loops, best of 3: 0.338 usec per loop
    facundo@pomcat:
    $ timeit.py -s "s='qwerty'"
    "s.startswith('q');s.startswith('x')"
    1000000 loops, best of 3: 0.854 usec per loop

    Thanks anyway!

    @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
    performance Performance or resource usage stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant