M
M
Max Payne2019-02-28 03:04:36
Python
Max Payne, 2019-02-28 03:04:36

Does speed increase when switching to asynchronous programming?

As far as I know, asynchronous programming, first of all, makes it possible to process a large number of requests simultaneously due to more rational use of processor time and blah blah blah ...
This is all great, but I would like to know if the performance increases ( specifically - the speed of obtaining the result) with a small number of simultaneous requests? Let's say - the average speed of a single request.
Interested primarily in the context of small-medium chatbots, with RPS not exceeding 1-2 * CPU_CORES, maybe someone converted a multithreaded / multiprocessor chatbot to asynchronous? In the context of web servers, the answers will also be useful.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
yayashitoya, 2019-02-28
@YardalGedal

The performance of the entire subsystem during the transition to asynchronous - falls.
But the speed of response to a specific request is increasing.
In the case of a single request, you are unlikely to notice the difference.
The difference will be noticeable only if you write really bad code in one of the cases.
1-2 * number of cores in RPS = 2-32 requests per second - this is not a load at all, even close.
On such a load, you need to write as it is more convenient .
Not so much faster.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question