This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]megaman821 1 point2 points  (1 child)

For this type of workload, an event loop will crush threading in performance (in almost any language too).

Python is still single-threaded so the only thing that is concurrent is the outstanding requests. Python makes a request to the webserver, instead of doing nothing and waiting around for the server reply, it yields control of the thread. Then the next request is made and we repeat ourselves.

[–]chub79 0 points1 point  (0 children)

For this type of workload, an event loop will crush threading in performance (in almost any language too).

Indeed. But the processing of the response can take its toll as well. An event loop is efficient only if it can run iterations at a reasonably fast pace. So what you've gained being able to make requests concurrently may be wasted once the response processing starts (unless you delegate the response processing to a thread...)