Daily Software Tips & Tricks

Bite-sized knowledge to improve your coding skills daily.

Don't Wait Serially for Parallel Tasks

February 9, 2026

If you have three independent API calls or database queries, resist the urge to `await` them one after the other. That makes your total execution time the sum of all three. If they don't depend on each other, fire them off simultaneously using `Promise.all()` (in JavaScript, or similar concurrency patterns in other languages).

For example, `const [user, posts] = await Promise.all([fetchUser(), fetchPosts()]);` This dramatically reduces latency, making your application feel much snappier because you only wait for the slowest task to complete, not the cumulative total.