Performance Metrics That Matter
| Metric | Target | Impact |
|---|---|---|
| Startup Time | < 2s cold start | User retention |
| Frame Rate | 60fps consistent | Perceived smoothness |
| Memory Usage | < 150MB average | Crash prevention |
| Battery Impact | < 5% per hour active | User satisfaction |
Rendering Optimization
FlatList Optimization
For long lists, proper FlatList configuration is critical for smooth scrolling.
<FlatList
data={items}
renderItem={renderItem}
keyExtractor={item => item.id}
getItemLayout={(data, index) => ({
length: ITEM_HEIGHT,
offset: ITEM_HEIGHT * index,
index
})}
removeClippedSubviews={true}
maxToRenderPerBatch={10}
windowSize={5}
/>Image Optimization
- Use WebP format for 25-35% smaller files
- Implement progressive loading with blur placeholders
- Cache aggressively with proper invalidation
- Resize images for different screen densities
Memory Management
// Avoid memory leaks: always clean up subscriptions
useEffect(() => {
const subscription = AppState.addEventListener('change', handler);
return () => subscription.remove();
}, []);
// Use lazy loading for heavy components
const HeavyComponent = React.lazy(() => import('./HeavyComponent'));Battery Efficiency
- Batch network requests instead of many small ones
- Use background fetch instead of continuous polling
- Implement proper location update strategies
- Minimize sensor usage when not needed
Profiling Tools
- React Native: Flipper, React DevTools Profiler
- Flutter: DevTools, Timeline view
- iOS: Instruments, Xcode Energy Log
- Android: Android Studio Profiler, Systrace