async function getDashboard(userId) {
const user = await fetchUser(userId);
const posts = await fetchPosts(userId);
return { user, posts };
}async function getDashboard(userId) {
const [user, posts] = await Promise.all([
fetchUser(userId),
fetchPosts(userId)
]);
return { user, posts };
}Bug: The two fetches run sequentially. fetchPosts waits for fetchUser to finish even though they're independent.
Explanation: Promise.all fires both requests simultaneously. If each takes 500ms, sequential = 1000ms, parallel = 500ms. Always parallelize independent async operations.
Key Insight: Sequential awaits for independent operations is a performance bug. Use Promise.all for parallel execution.