Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Apply 62 React and Next.js performance optimization rules from Vercel Engineering
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
rules/async-parallel.md
1---2title: Promise.all() for Independent Operations3impact: CRITICAL4impactDescription: 2-10× improvement5tags: async, parallelization, promises, waterfalls6---78## Promise.all() for Independent Operations910When async operations have no interdependencies, execute them concurrently using `Promise.all()`.1112**Incorrect (sequential execution, 3 round trips):**1314```typescript15const user = await fetchUser()16const posts = await fetchPosts()17const comments = await fetchComments()18```1920**Correct (parallel execution, 1 round trip):**2122```typescript23const [user, posts, comments] = await Promise.all([24fetchUser(),25fetchPosts(),26fetchComments()27])28```29