-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed
Labels
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>".
It 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.
This can be don
69F8
e by storing the counter in the task struct, and using it to lazily populate the name in the get_name method.
Linked PRs
Metadata
Metadata
Assignees
Labels
Projects
Status
Done