4 ms·
It increases efficiency, in the same sense as prior solutions for the same problem increased efficiency. E.g. if you write a webserver which intends to handle L
by Matthias247 4y ago
It increases efficiency, in the same sense as prior solutions for the same problem increased efficiency. E.g. if you write a webserver which intends to handle LOTS of active connections (5-7 digits of them), you might end up being able to handle N connections with a classic OS thread per request model (as e.g. original Apache used it).
Going to an fully async model - as used e.g. in Nginx - will allow to make it 2xN connections for the same hardware, in exchange for having to deal with a lot more complexity during implementation. Which means you can either serve 2x as much traffic, or pay 50% of hardware and energy cost for the same amount => This is the increase in efficiency.
Goig from a "low level async" (callbacks, reactor/proactor/etc) model to async/await intends to mostly keep the increase in efficiency, while making the programming model a bit more bearable and less error-prone.