
The Real Cost of an async Call
Awaiting a coroutine that never suspends costs 53 ns against 24 ns for a plain call. Wrapping the same coroutine in a Task and awaiting it costs 28,958 ns.
2 posts

Awaiting a coroutine that never suspends costs 53 ns against 24 ns for a plain call. Wrapping the same coroutine in a Task and awaiting it costs 28,958 ns.

An instance with three attributes costs 96 bytes, not the 344 that sys.getsizeof reports, and __slots__ makes attribute reads slower on CPython 3.13.