Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Speed up pathlib by removing a few temporary objects #112361

Closed
@barneygale

Description

@barneygale

A handful of pathlib methods that create paths with modified names, or additional segments, use list objects that are quickly thrown away. We can speed these methods up by only creating new lists where strictly necessary.

Specifically:

  • with_name() (performance ofself._tail[:-1] + [name] is cursed)
  • with_suffix()
  • _make_child_relpath() (used inglob() andwalk())
  • glob() (when parsing the pattern)

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp