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-115060: Speed up pathlib.Path.glob() by not scanning literal parts #117732

Merged
merged 4 commits into from
Apr 12, 2024

Commits on Apr 10, 2024

  1. pythonGH-115060: Speed up pathlib.Path.glob() by not scanning liter…

    …al parts
    
    Don't bother calling `os.scandir()` to scan for literal pattern segments,
    like `foo` in `foo/*.py`. Instead, append the segment(s) as-is and call
    through to the next selector with `exists=False`, which signals that the
    path might not exist. Subsequent selectors will call `os.scandir()` or
    `os.lstat()` to filter out missing paths as needed.
    barneygale committed Apr 10, 2024
    Configuration menu
    Copy the full SHA
    f1b3b0e View commit details
    Browse the repository at this point in the history
  2. Fix tests, add comment.

    barneygale committed Apr 10, 2024
    Configuration menu
    Copy the full SHA
    4c48dc0 View commit details
    Browse the repository at this point in the history
  3. More test fixes

    barneygale committed Apr 10, 2024
    Configuration menu
    Copy the full SHA
    0e7aee7 View commit details
    Browse the repository at this point in the history
  4. Once more with feeling

    barneygale committed Apr 10, 2024
    Configuration menu
    Copy the full SHA
    c4e3edc View commit details
    Browse the repository at this point in the history