python-web-perf icon indicating copy to clipboard operation
python-web-perf copied to clipboard

Good experiment, I have reproduced most of your results.

Open Sraw opened this issue 4 years ago • 2 comments

First, thank you for doing such a lot of works, they are really valuable.

Then, I have reproduced most of your results. Except that I change those DB connections with a simple sleep method to simulate infinite DB resources. Yes, the sync frameworks perform better. It surprises me actually.

Next, I did a further adjustment, I try to simulate a heavy backend communication workload. Which is just simply raising sleep time to 50ms. In this case, async and sync performs pretty close. And when I increase the sleep time more, async ones finally perform a little bit better than the sync ones.

To summarize, I am not sure about the critical reason for this counterintuitive result, but I believe it is because that Python itself is slow. So when we have more native codes, we are better. Whatever, it is still intuitive that async ones perform better when it comes to waiting for a long time.

We need to realize this fact, and hope we will have a better implementation of Python in the future.

Sraw avatar Jul 15 '20 01:07 Sraw

Hi, thanks for taking the time to do that.

When you talk about 50ms sleep times - you're talking about emulating a database query that takes 50ms?

calpaterson avatar Jul 15 '20 14:07 calpaterson

Yes, or no. It could be a database query or any other IO. For example, it can be a call to another backend server.

Sraw avatar Jul 15 '20 16:07 Sraw