mobile-perf
Optimizes React Native Expo applications for speed, responsiveness, and battery efficiency. Use when fixing lag, optimizing lists, or reducing bundle size.
When & Why to Use This Skill
The Mobile Performance Skill is a specialized tool for optimizing React Native and Expo applications to achieve peak speed, responsiveness, and battery efficiency. It focuses on eliminating UI lag, optimizing heavy list rendering, and reducing JavaScript bundle sizes. By leveraging advanced techniques like UI-thread animations and efficient memory management, it ensures a high-performance, 'butter-smooth' user experience across mobile platforms.
Use Cases
- Eliminating Scroll Lag: Optimizing complex lists by implementing LegendList or fine-tuning FlatList properties to ensure smooth scrolling with large datasets.
- Reducing App Load Times: Analyzing and shrinking the JavaScript bundle size using tools like expo-bundle-analyzer to improve initial launch speed.
- Smooth UI Animations: Refactoring animations to run exclusively on the UI thread using react-native-reanimated, preventing frame drops during heavy JS execution.
- Resource & Battery Optimization: Identifying memory leaks and minimizing bridge traffic to reduce power consumption and improve overall app stability.
| name | mobile-perf |
|---|---|
| description | Optimizes React Native Expo applications for speed, responsiveness, and battery efficiency. Use when fixing lag, optimizing lists, or reducing bundle size. |
Mobile Performance Skill
This skill focuses on delivering a "butter-smooth" user experience.
Focus Areas
- List Optimization: Use
LegendListor highly optimizedFlatListsettings. - Animation Performance: Ensure all animations run on the UI thread using
react-native-reanimated. - Image Handling: Use
expo-imagefor caching and performant loading. - JS Bundle Size: Analyze and reduce the size of the JavaScript bundle.
- Memory Leaks: Identify and fix component memory leaks or excessive re-renders.
Instructions
- Profile: Identify the bottleneck (JS thread vs UI thread).
- Optimize Lists: Use
removeClippedSubviews,maxToRenderPerBatch, andinitialNumToRender. - Memoization: Apply
useMemoanduseCallbackjudiciously to prevent unnecessary renders. - Bridge Traffic: Minimize the data sent across the React Native bridge.
Recommended Tools
Flashlightfor performance testing.react-devtoolsfor profiling renders.expo-bundle-analyzerto check bundle composition.