Performance Optimization for Mobile Apps
Performance isn't a feature—it's a baseline. Slow apps frustrate users everywhere, but on tier-2 phones with 2GB RAM, sluggish performance is a dealbreaker.
Measuring Performance
App startup time: Time from tap to interactive screen. Anything over 5 seconds loses users. Target sub-2 seconds.
Frame rate: 60 FPS is standard. Anything below 40 FPS feels janky. Monitor with profilers, not just feeling.
Memory footprint: Keep apps under 100MB of RAM. Cheap phones have 2-4GB total; a 500MB app consumes 12% of system memory.
Code Splitting and Lazy Loading
Don't ship all code upfront. Load screens and features on-demand. React Native with Hermes uses ahead-of-time compilation to preload critical paths while deferring heavy libraries.
Flutter achieves similar results through tree-shaking—the compiler removes unused code. A minimal Flutter app is 15MB; bloated apps double that size.
Image Optimization
Images dominate app sizes. Optimize ruthlessly:
- Format selection: WebP for static content, vector SVGs for icons.
- Responsive images: Serve different sizes for different devices. A 1080px image on a 480px phone wastes bandwidth and memory.
- Compression: Use JPEG quality 70-80 for photos; PNG for graphics.
- CDN delivery: Cache images near users, compress on-the-fly.
A poorly optimized app with uncompressed images can be 200MB; well-optimized, the same app is 40MB.
Runtime Performance
Avoid frame drops: Batch DOM updates (React), use const constructors (Flutter), minimize garbage collection pauses.
Caching strategies: Cache API responses aggressively. A second fetch of the same data should be instant from cache.
Database queries: Indexed queries complete in milliseconds. Unindexed table scans on 100K records halt the UI.
Battery and Network
Battery: Animations sip battery; 60 FPS scrolling costs less than you'd think. Background location tracking costs the most.
Network: Batch API calls, compress payloads (gzip), reuse HTTP connections (connection pooling).
Profiling Tools
React Native: Flipper debugger, Android Studio Profiler, Chrome DevTools.
Flutter: DevTools performance tab, Android Profiler.
iOS: Xcode Instruments.
Profile on real devices, not simulators. A simulator hides performance issues the real phone will surface.
Frequently asked questions
What's a good app startup time target?
Aim for sub-2 seconds from tap to interactive screen. Anything over 5 seconds causes user abandonment. Measure cold start (first launch) separately from warm start.
How do I reduce app size?
Code splitting, lazy loading, image optimization, and tree-shaking. Remove unused dependencies. Dynamic feature modules defer non-critical code.
Should I use lossy or lossless image compression?
Lossy (JPEG 70-80 quality) for photos. Lossless (PNG) for graphics. WebP for everything if supported. Test on real devices to find the quality threshold.