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

GH-101362: Optimise PurePath(PurePath(...)) #101667

Merged

Commits on Feb 7, 2023

  1. pythonGH-101362: Optimise PurePath(PurePath(...))

    The previous `_parse_args()` method pulled the `_parts` out of any
    supplied `PurePath` objects; these were subsequently joined in
    `_from_parts()` using `os.path.join()`. This is actually a slower form of
    joining than calling `fspath()` on the path object, because it doesn't take
    advantage of the fact that the contents of `_parts` is normalized!
    
    This reduces the time taken to run `PurePath("foo", "bar") by ~20%, and
    the time taken to run `PurePath(p, "cheese")`, where
    `p = PurePath("/foo", "bar", "baz")`, by ~40%.
    barneygale committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    b01c352 View commit details
    Browse the repository at this point in the history

Commits on Feb 25, 2023

  1. Configuration menu
    Copy the full SHA
    6db6d55 View commit details
    Browse the repository at this point in the history

Commits on Feb 28, 2023

  1. Add tests for bytes paths.

    barneygale committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    1b9e2d3 View commit details
    Browse the repository at this point in the history

Commits on Mar 5, 2023

  1. Configuration menu
    Copy the full SHA
    bee1ab5 View commit details
    Browse the repository at this point in the history
  2. Apply suggestions from code review

    Co-authored-by: Alex Waygood <[email protected]>
    barneygale and AlexWaygood authored Mar 5, 2023
    Configuration menu
    Copy the full SHA
    37be083 View commit details
    Browse the repository at this point in the history
  3. Update Misc/NEWS.d/next/Library/2023-02-07-22-20-32.gh-issue-101362.J…

    …lk6mt.rst
    
    Co-authored-by: Alex Waygood <[email protected]>
    barneygale and AlexWaygood authored Mar 5, 2023
    Configuration menu
    Copy the full SHA
    782a940 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0ecae3d View commit details
    Browse the repository at this point in the history
  5. Improve TypeError message

    barneygale committed Mar 5, 2023
    Configuration menu
    Copy the full SHA
    fbfeedb View commit details
    Browse the repository at this point in the history