Title: Speed up `pathlib.Path.glob()` by working with strings internally · Issue #117586 · python/cpython · GitHub
Open Graph Title: Speed up `pathlib.Path.glob()` by working with strings internally · Issue #117586 · python/cpython
X Title: Speed up `pathlib.Path.glob()` by working with strings internally · Issue #117586 · python/cpython
Description: pathlib.Path.glob() currently generates Path objects for intermediate paths that might never be yielded to the user, which is slow and unnecessary. For example, a pattern like **/*.mp3 is evaluated by creating a Path object for every dir...
Open Graph Description: pathlib.Path.glob() currently generates Path objects for intermediate paths that might never be yielded to the user, which is slow and unnecessary. For example, a pattern like **/*.mp3 is evaluated...
X Description: pathlib.Path.glob() currently generates Path objects for intermediate paths that might never be yielded to the user, which is slow and unnecessary. For example, a pattern like **/*.mp3 is evaluated...
Opengraph URL: https://github.com/python/cpython/issues/117586
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Speed up `pathlib.Path.glob()` by working with strings internally","articleBody":"`pathlib.Path.glob()` currently generates `Path` objects for intermediate paths that might never be yielded to the user, which is slow and unnecessary. For example, a pattern like `**/*.mp3` is evaluated by creating a `Path` object for every directory visited.\r\n\r\nThere are already few tricks employed to avoid instantiation, but it would be better if only _real results_ were converted to path objects.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-117589\n* gh-117726\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/barneygale","@type":"Person","name":"barneygale"},"datePublished":"2024-04-06T18:47:26.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/117586/cpython/issues/117586"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:878dee9f-98d3-f22a-9ac5-2cbe5dd75e5d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D960:2F5E76:821AF0:AA91D3:696B15FA |
| html-safe-nonce | f2ecde66d1f49633e5a39bbe8521c5cff4731e0b14a10cd017dba83a1f37c475 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOTYwOjJGNUU3Njo4MjFBRjA6QUE5MUQzOjY5NkIxNUZBIiwidmlzaXRvcl9pZCI6IjE5NDYzMTg2NDMwMjgyMzU3NzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 50f53783b6ae73498f5fe67f91d2012166a4e350cee4b5176d1254d95ffb6966 |
| hovercard-subject-tag | issue:2229362831 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/117586/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a7ac1b5b04d9ffb260b11341a033ce55772471a300cb7b0947c84e0f65dbbbaf/python/cpython/issues/117586 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a7ac1b5b04d9ffb260b11341a033ce55772471a300cb7b0947c84e0f65dbbbaf/python/cpython/issues/117586 |
| og:image:alt | pathlib.Path.glob() currently generates Path objects for intermediate paths that might never be yielded to the user, which is slow and unnecessary. For example, a pattern like **/*.mp3 is evaluated... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | barneygale |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width