<story><title>Python Asyncio</title><url>https://superfastpython.com/python-asyncio/</url></story><parent_chain><item><author>kissgyorgy</author><text>After 2 years of using asyncio in production, I recommend to avoid it if you can. With async programming, you take the complexity of concurrent programming, which is way harder than you can imagine.&lt;p&gt;Also nobody mentions this for some reason, but asyncio doesn&amp;#x27;t make your programs faster, in fact it makes everything 100x SLOWER (we measured it multiple times, compared the same thing to the sync version), but makes your program concurrent (NOT parallel), where the tradeoff is you use more CPU, maybe less memory, and can saturate your bandwidth better. Never do anything CPU-bound in an async loop!</text></item></parent_chain><comment><author>number6</author><text>Asyncio is not ment for CPU Bound Task but for IO Bound Tasks.
You should have used multiprocessing.
The problem you describe is exactly what asyncio is used for: saturate your bandwidth better.&lt;p&gt;maybe the right aproach would have been a Threadpool? Plus you don&amp;#x27;t have to refractor the task. Just let it run sync, but you can make it also async</text></comment>
<story><title>Python Asyncio</title><url>https://superfastpython.com/python-asyncio/</url></story><parent_chain><item><author>kissgyorgy</author><text>After 2 years of using asyncio in production, I recommend to avoid it if you can. With async programming, you take the complexity of concurrent programming, which is way harder than you can imagine.&lt;p&gt;Also nobody mentions this for some reason, but asyncio doesn&amp;#x27;t make your programs faster, in fact it makes everything 100x SLOWER (we measured it multiple times, compared the same thing to the sync version), but makes your program concurrent (NOT parallel), where the tradeoff is you use more CPU, maybe less memory, and can saturate your bandwidth better. Never do anything CPU-bound in an async loop!</text></item></parent_chain><comment><author>acedTrex</author><text>This is an insane take, if you are doing async you already HAVE a need for concurrent programming. Async just makes that simpler to read and write.</text></comment>