Skip to content

Optimize Path.cwd() in pathlib #88136

Description

@kfollstad
mannequin
BPO 43970
Nosy @ericvsmith, @kfollstad
PRs
  • bpo-43970: Optimize Path.cwd() in pathlib #25699
  • 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 2021-04-28.23:03:04.453>
    created_at = <Date 2021-04-28.20:41:53.343>
    labels = ['library', '3.10', 'performance']
    title = 'Optimize Path.cwd() in pathlib'
    updated_at = <Date 2021-04-28.23:03:04.453>
    user = 'https://github.com/kfollstad'

    bugs.python.org fields:

    activity = <Date 2021-04-28.23:03:04.453>
    actor = 'eric.smith'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-04-28.23:03:04.453>
    closer = 'eric.smith'
    components = ['Library (Lib)']
    creation = <Date 2021-04-28.20:41:53.343>
    creator = 'kfollstad'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 43970
    keywords = ['patch']
    message_count = 3.0
    messages = ['392255', '392266', '392267']
    nosy_count = 2.0
    nosy_names = ['eric.smith', 'kfollstad']
    pr_nums = ['25699']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'performance'
    url = 'https://bugs.python.org/issue43970'
    versions = ['Python 3.10']

    Activity

    1. kfollstad commented on Apr 28, 2021

      kfollstadmannequin
      MannequinAuthor

      python3.10 -m timeit -r 5 -n 100000 -s 'from pathlib import Path' 'Path.cwd()'
      100000 loops, best of 5: 206 usec per loop

      python3.10-mypatch -m timeit -r 5 -n 100000 -s 'from pathlib import Path' 'Path.cwd()'
      100000 loops, best of 5: 156 usec per loop

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      performancePerformance or resource usage
      on Apr 28, 2021
    3. ericvsmith commented on Apr 28, 2021

      @ericvsmith
      Member

      New changeset 4a85718 by kfollstad in branch 'master':
      bpo-43970: Optimize Path.cwd() in pathlib by not instantiating a class unnecessarily (GH-25699)
      4a85718

    4. ericvsmith commented on Apr 28, 2021

      @ericvsmith
      Member

      I'm merging this not so much because of the performance aspect, but just to remove some unnecessary code.

      But in any event, thanks for the contribution!

    5. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.10 (EOL)end of lifeperformancePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directory

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions