r/Python • • Nov 30 '22

Resource Async Python is not faster - excellent analysis from Cal Paterson

https://calpaterson.com/async-python-is-not-faster.html
11 Upvotes

18 comments sorted by

View all comments

6

u/blabbities Dec 01 '22

I swear I can view a thousand Async/Concurrency blogs, papers, docs,and vids. I'll never really understand it.

In fact I have a Python page that "explains it well" on one of my VMs right now. this blog seem cool too but I guess. I've also made one python program that used it and saw the improved speeds. I also am learning GoLang in which Concurrency is like first-class thought in it's language design.... Tho somehow I just don't get it.

Maybe it's that I fear diving more into it because Im not doing big data projects and I'm afraid of the complex debugging issues.

Anyway good blog. Adding it to my saves 😂.

2

u/[deleted] Dec 01 '22

Some coding / tasks simply aren't a good fit for asyncio.

Image this one. Web server serves https:// (short connection) + wss:// (long connection) and also has a MQTT server connection and database connection.

Some requests via websocket will generate multiple requests out to db server and MQTT server. Each of these has different timeouts.

Also, the websocket connection has an application level KEEP ALIVE heartbeat. So if no activity on the connection in 30 secs, a PING PONG keep alive is exchanged.

This scenario is easily handled via async.