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/js-cache-property-access.md
1---2title: Cache Property Access in Loops3impact: LOW-MEDIUM4impactDescription: reduces lookups5tags: javascript, loops, optimization, caching6---78## Cache Property Access in Loops910Cache object property lookups in hot paths.1112**Incorrect (3 lookups × N iterations):**1314```typescript15for (let i = 0; i < arr.length; i++) {16process(obj.config.settings.value)17}18```1920**Correct (1 lookup total):**2122```typescript23const value = obj.config.settings.value24const len = arr.length25for (let i = 0; i < len; i++) {26process(value)27}28```29