Hacker News new | ask | show | jobs
by 32gbsd 2471 days ago
> Python introduced a concept, async/await, to help developers write understandable code with high performance is it actually better or is it just a new kind of threading/loop? being understandable is second fiddle.
2 comments

I think C# had it long before python did...
async/await is a better design pattern without considering low-level APIs such as epoll. It is not a new kind of threading/loop. Python provides a user-level scheduler for developers, so they don't need to implement their scheduler from scratch. In my opinion, the reason why using an event loop can acquire better performance is to decrease the number of times to lock some critical sections. Also, this pattern can increase the cache hit and mitigate CPU context switch frequency.