Hacker News new | ask | show | jobs
by l_theanine 1205 days ago
I haven't used asyncio that much, certainly not in any serious sense, but wouldn't ContextVar lookups be a major factor of performance in serious asyncio code? Using tasks for things that aren't io-bound seems likely to give a false sense of performance superiority when doing basically nothing.
1 comments

I’d be surprised if context vars are more expensive than a dict lookup or two. But I haven’t profiled. Could be wrong.