Title: Defer string formatting in asyncio Task creation · Issue #103793 · python/cpython · GitHub
Open Graph Title: Defer string formatting in asyncio Task creation · Issue #103793 · python/cpython
X Title: Defer string formatting in asyncio Task creation · Issue #103793 · python/cpython
Description: Feature or enhancement When an asyncio Task is created without passing in a name (a common case), the init method uses a global counter to generate a task name of the form "Task-
Open Graph Description: Feature or enhancement When an asyncio Task is created without passing in a name (a common case), the init method uses a global counter to generate a task name of the form "Task-
X Description: Feature or enhancement When an asyncio Task is created without passing in a name (a common case), the init method uses a global counter to generate a task name of the form "Task-<counter>...
Opengraph URL: https://github.com/python/cpython/issues/103793
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Defer string formatting in asyncio Task creation","articleBody":"# Feature or enhancement\r\n\r\nWhen an asyncio Task is created without passing in a `name` (a common case), the init method uses a global counter to generate a task name of the form `\"Task-\u003ccounter\u003e\"`.\r\n\r\nIt is very common in applications that the task name is never read or used, and string formatting has non-negligible runtime cost, making task creation slower. It would be beneficial to defer the string formatting operation and avoid incurring that overhead during task creation.\r\n\r\nThis can be done by storing the counter in the task struct, and using it to lazily populate the name in the `get_name` method.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-103767\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/itamaro","@type":"Person","name":"itamaro"},"datePublished":"2023-04-24T20:30:18.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/103793/cpython/issues/103793"}
| 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:4cf7cbee-c022-cb95-291b-921379b2018d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C966:F2B91:1147F2C:171FF34:6969AA1C |
| html-safe-nonce | 12a9fce72e5892955e68b2e78163e3d44ae4a0968a323e2bcd04cb24a12045c8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTY2OkYyQjkxOjExNDdGMkM6MTcxRkYzNDo2OTY5QUExQyIsInZpc2l0b3JfaWQiOiIyNzM0MzI0NTUyMDQ3MzcyODI4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e5ea2a20a3b1dc0f09eea086b7bb0f327b3a3fa2571391871f180fba028307a6 |
| hovercard-subject-tag | issue:1681987021 |
| 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/103793/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fc6525feccb2be1cb72b75f01a446cb2e08cb11cbddb6e1d9e0802f1ec8fe6d7/python/cpython/issues/103793 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fc6525feccb2be1cb72b75f01a446cb2e08cb11cbddb6e1d9e0802f1ec8fe6d7/python/cpython/issues/103793 |
| og:image:alt | Feature or enhancement When an asyncio Task is created without passing in a name (a common case), the init method uses a global counter to generate a task name of the form "Task- |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | itamaro |
| hostname | github.com |
| expected-hostname | github.com |
| None | 24c4c97a2d520cb286b35e1a4c22d7a4df3c26a2fa28dd7cdf0e65db327b4de7 |
| 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 | 124667f43168afb6c9c03b7c02eb5b1d2e1be3d9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width