So sánh Promise.all() vs async await

I remember a junior developer on my team once came to me, frustrated that an API call was taking way too long — around 19 seconds in total. He was using async/await and assumed it was automatically the most efficient approach.

But when I looked at the code, I immediately spotted the issue:

const res1 = await fetchA();
const res2 = await fetchB();
const res3 = await fetchC();

Each call was waiting for the previous one to finish — completely sequential. No wonder it was slow.

I suggested a small change that made a huge impact:

const [res1, res2, res3] = await Promise.all([
fetchA(),
fetchB(),
fetchC(),
]);

Just like that, the total response time dropped from 19 seconds to just 90ms. All because the API calls started running in parallel, not one after the other.

Key takeaway:
Using async/await doesn’t automatically mean your code is fast. When your async calls don’t depend on each other, Promise.all() can make a night-and-day difference.

I love moments like these — small tweaks, big wins.

Have you ever made (or fixed) a similar async/await mistake? Would love to hear!