7 ms·
IO is blocking within that request. There's no way around that. The difference between sync and async is that with the latter, the event loop from the blocking
by peller 3y ago
IO is blocking within that request. There's no way around that. The difference between sync and async is that with the latter, the event loop from the blocking request is freed up to handle other requests, which is where the performance gain is. If there's only a single request, then sync and async are going to look largely the same from the outside. However if there's thousands of requests, async is going to do much better.
- manvillej 3y agoyup! I think of it like cooking. If you're only cooking one thing, sync & async look the same. But if you're cooking several things, you can switch between dishes as needed (asynchronous) instead of cooking each dish one at a time (synchronous)