Performance: Promise.all for parallel execution
MEDIUM IMPACT
This affects how quickly multiple asynchronous tasks complete and how the event loop handles concurrency.
async function fetchParallel() { const results = await Promise.all([fetch(url1), fetch(url2)]); return results; }
async function fetchSequential() { const result1 = await fetch(url1); const result2 = await fetch(url2); return [result1, result2]; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Sequential await calls | N/A | N/A | Blocks event loop longer | [X] Bad |
| Promise.all parallel execution | N/A | N/A | Non-blocking, faster completion | [OK] Good |