3 ms·
> it would speed up a lot of io operations It doesn't speed up the I/O operation, but allows the CPU to continue executing other code rather than blocking and
by tomnipotent 3y ago
> it would speed up a lot of io operations
It doesn't speed up the I/O operation, but allows the CPU to continue executing other code rather than blocking and waiting (and the program becoming unresponsive).
If your app is querying a database ten times per user request and averaging 5-10ms per query, your CPU is spending 50-100ms doing nothing but waiting on the network to finish so it can resume executing the code that comes next. That's time other code that has CPU instructions that can execute now would benefit from.