3 ms·
No, I mean that yielding allows more requests to be executed at the same time on the same number of threads, increasing throughput. Overhead of context switches
by SideburnsOfDoom 5y ago
No, I mean that yielding allows more requests to be executed at the same time on the same number of threads, increasing throughput. Overhead of context switches is not that relevant, this is are small fry compared to e.g. waiting 100s of milliseconds (or more) for a DB or API. Yielding instead of busy-waiting, as I said above, allow another request that is ready to execute to do so sooner. This leads to higher throughput.
The other reply from reubenbond ( https://twitter.com/reubenbond https://twitter.com/reubenbond ) is correct. Also the implication that async does sometimes decrease end-to-end latency because you don't have wait for request A to complete before starting request B.
async/await is not the same thing as threading, it is about using a fraction of a thread: when awaiting, "there is no thread" being used.
https://blog.stephencleary.com/2013/11/there-is-no-thread.html https://blog.stephencleary.com/2013/11/there-is-no-thread.ht...
> I believe you mean the exact opposite.
As an aside, how about you say what you mean, and I'll work on what I mean.