Audit the codebase (or the path in $ARGUMENTS) for the React Native performance antipatterns that actually matter. Read-only: report, do not edit.
Hunt for these, in priority order:
- Lists: ScrollView wrapping
.map()over data of meaningful size; FlatList/FlashList with inline arrowrenderItem; missing or index-basedkeyExtractor; list images without fixed dimensions. - Subscriptions: components subscribing to whole stores (
useStore()with no selector, or selectors returning fresh objects); context providers bundling fast-changing values with static ones. - Render work: heavy computation directly in render without memoization; date/number formatting per row per render; JSON.parse of large payloads on the interaction path.
- Animations: setState driving per-frame animation; runOnJS inside gesture or frame callbacks; PanResponder where gesture-handler belongs; animating layout properties instead of transform/opacity.
- Startup: heavy SDK/analytics initialization at module top level; barrel imports that pull the world into the entry file; synchronous storage reads before first render.
- Leftovers: console.log in hot paths that ship to release; dev-only tooling imported unconditionally.
Method: grep for the patterns, then READ each hit before reporting it. A ScrollView over four static children is fine; the same over a fetched array is a finding. Judgment beats pattern-matching, and false accusations burn the reader's trust in the whole report.
Report format:
- Ranked findings, worst first. Each:
file:line, the pattern, why it costs here specifically, and the one-line direction of the fix. - Skip theory. No finding, no entry; an honest "lists are clean" beats padding.
- Close with the top three fixes worth doing this week. Verification means re-measuring in a release build, not eyeballing the simulator; say so at the end of the report.