Independent awaits in sequence
Why it matters
Each await waits for the previous one even though it doesn't use its result: the latencies add up (a waterfall) on every request.
Fix
Start both, then await together: const [a, b] = await Promise.all([readA(), readB()]).
Credit
References
- Fetching DataNext.js
- react-best-practices: Promise.all() for independent operationsVercel (vercel-labs/agent-skills)
- Promise.all()MDN Web Docs
- better-all: Better Promise.all with automatic dependency optimizationGitHub (shuding)