Title: Speed up pathlib by removing a few temporary objects · Issue #112361 · python/cpython · GitHub
Open Graph Title: Speed up pathlib by removing a few temporary objects · Issue #112361 · python/cpython
X Title: Speed up pathlib by removing a few temporary objects · Issue #112361 · python/cpython
Description: 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: w...
Open Graph Description: 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 w...
X Description: 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 w...
Opengraph URL: https://github.com/python/cpython/issues/112361
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Speed up pathlib by removing a few temporary objects","articleBody":"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.\r\n\r\nSpecifically:\r\n\r\n- `with_name()` (performance of `self._tail[:-1] + [name]` is cursed)\r\n- `with_suffix()`\r\n- `_make_child_relpath()` (used in `glob()` and `walk()`)\r\n- `glob()` (when parsing the pattern)\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-112362\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/barneygale","@type":"Person","name":"barneygale"},"datePublished":"2023-11-24T09:25:28.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/112361/cpython/issues/112361"}
| 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:be16f089-ade6-6ea3-e482-26979c31a285 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C89C:2518BB:6B6003:8931BF:696B14D2 |
| html-safe-nonce | 29a826a208873eb41085d7a909ec786738535dbfa631e280e159f5b77f0a4806 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODlDOjI1MThCQjo2QjYwMDM6ODkzMUJGOjY5NkIxNEQyIiwidmlzaXRvcl9pZCI6IjQ2MjMxNzIyNjE2ODkxMDM1NzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ec0f1ed7919a2c01d24b7e5be13d31f4fcc8ccc6c1b91a1b70ae6fb24ee3824a |
| hovercard-subject-tag | issue:2009386218 |
| 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/112361/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b451bf24f1f00d9fe8e3823e6b5e8772d92168b0774ca11e70693df0089b7f9b/python/cpython/issues/112361 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b451bf24f1f00d9fe8e3823e6b5e8772d92168b0774ca11e70693df0089b7f9b/python/cpython/issues/112361 |
| og:image:alt | 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 w... |
| 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 | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width