Skip to content

Optimize pathlib path construction #101362

Closed
@barneygale

Description

@barneygale

Pathlib is slow. One of the most obvious symptoms is that pathlib.PurePath objects are slow to construct. We should be able to speed construction up without making other parts of pathlib slower.

Two possible approaches:

  1. Optimize the existing machinary of path construction: __new__(), _from_parts(), _parse_parts(), _parse_args().
  2. Perform less work in the constructor: defer parsing, joining and normalization until needed.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions