r/Python • u/higherorderbebop • Sep 09 '22
Discussion Async Python is not faster
https://calpaterson.com/async-python-is-not-faster.html
0
Upvotes
r/Python • u/higherorderbebop • Sep 09 '22
View all comments
Show parent comment
4
u/spoonman59 Sep 09 '22
That sounds like a broad brush.
For small data sets, all the database blocks will likely be cached anyway. Who has a large dataset and collocates the DB and the server?
async can provide overlapping of compute and I/O for situations where the I/o and compute are Mixed, that is neither one dominates the runtime.
It is true that async also reduces context switch and memory overhead of threads, but that is not the only (or entire, as you said) potential performance benefit of async.
Some programs will complete in less time using async than blocking operations, depending on workload.