ESC
Type to search guides, tutorials, and reference documentation.
Verified by Garnet Grid

Mobile Performance Optimization

Optimize mobile app performance for smooth 60fps experiences. Covers startup time, memory management, battery optimization, network efficiency, and profiling tools for iOS and Android.

Mobile performance is measured differently than web performance. Users notice jank at 16ms, battery drain over hours, and data usage over cellular connections. The constraints are harder — limited CPU, limited memory, limited bandwidth, limited battery — and the expectations are higher because native apps are supposed to feel instant.


Performance Metrics

MetricTargetMeasurement Tool
Cold start time< 1 secondiOS: Instruments, Android: adb
Warm start time< 500msTime to interactive
Frame rate60 fps (16.6ms per frame)Core Animation, GPU rendering
Memory usage< 200MB typicalInstruments, Android Profiler
Battery impact< 5% per hour active useEnergy Diagnostics, Battery Historian
App size< 50MB download (ideally < 20MB)App Store Connect, Play Console
Network dataMinimize redundant transfersCharles Proxy, Network Monitor

Startup Optimization

PhaseWhat HappensOptimization
Process creationOS launches process (10-50ms)Cannot optimize
Runtime initializationLoad frameworks, initialize runtime (50-200ms)Reduce linked frameworks, lazy load
App initializationAppDelegate/Application setup (50-500ms)Defer non-critical work
First frameLayout + render first screen (100-300ms)Pre-computed layouts, skeleton screens
Data loadingNetwork/cache → populate UI (200ms-2s)Cache first, background refresh

Techniques

TechniqueiOSAndroid
Lazy initializationDefer service setup to first useLazy properties, WorkManager for deferred
Module loadingReduce linked dylibsReduce dex file count
Skeleton screensShow placeholder UI immediatelyShimmerLayout, Compose placeholders
Pre-warm dataCache critical data on diskRoom/DataStore pre-population
Reduce main thread workMove initialization off mainMove work to background dispatchers

Memory Management

IssueSymptomDiagnosticFix
Memory leakGrowing memory over timeInstruments Leaks, LeakCanaryFix retain cycles, clear references
Image memoryLarge memory spike on image loadMemory graph debuggerDownscale images, use disk cache
Cache unboundedMemory grows with dataMemory monitorLRU cache with size limit
View controller leakMemory grows on navigationInstruments AllocationsWeak references in closures/callbacks
Retained fragmentsAndroid memory growthAndroid ProfilerProper fragment lifecycle

Image Memory Rules

Image SizeRaw MemoryOptimization
4000×3000 (12MP photo)~48 MBDownscale to display size
1080×1920 (phone screen)~8 MBAcceptable for full-screen
100×100 (avatar)~40 KBCache in memory

Battery Optimization

Battery Drain SourceImpactMitigation
GPS (continuous)Very highRequest only when needed, significant location changes
Network (polling)HighPush notifications instead of polling
CPU (background)Medium-highBackground task time limits
Screen renderingMediumAvoid unnecessary re-renders
Bluetooth scanningMediumScan only when user initiates
AnimationsLow-mediumUse hardware-accelerated animations

Network Optimization

TechniqueWhat It DoesSavings
Response cachingCache API responses locally50-80% fewer requests
Image CDNServe right-sized images60-80% image data savings
Request batchingCombine multiple API callsFewer connections
Delta syncSend only changes since last sync90%+ data savings for sync
Compressiongzip/brotli responses60-80% response size reduction
Offline-firstWork without network, sync later100% savings when offline

Profiling Tools

ToolPlatformBest For
Xcode InstrumentsiOSCPU, memory, energy, network profiling
Android Studio ProfilerAndroidCPU, memory, network, energy
Charles ProxyBothNetwork traffic inspection
Firebase PerformanceBothReal-user performance monitoring
FlipperBothDebug tool with plugins
LeakCanaryAndroidAutomatic memory leak detection

Anti-Patterns

Anti-PatternProblemFix
Loading full-res imagesMemory spikes, OOM crashesResize to display dimensions
Polling for updatesBattery drain, bandwidth wastePush notifications, WebSocket
Synchronous network on main threadUI freezesAsync networking, loading states
No image cachingRe-downloads same imagesDisk + memory cache (Kingfisher, Coil)
Unbounded listsMemory grows with dataRecycler views, lazy lists
No startup profilingSlow cold start unnoticedMeasure and track app startup time

Checklist

  • Cold start time < 1 second
  • Maintain 60 fps in all scrolling and animations
  • Memory leaks monitored and fixed (LeakCanary, Instruments)
  • Images resized to display dimensions before loading
  • Network requests cached with appropriate TTL
  • Battery impact profiled and optimized
  • App size monitored with alerts on regression
  • Background work minimized and scheduled appropriately
  • Real-user performance monitoring in production (Firebase Performance)
  • Performance regression testing in CI

:::note[Source] This guide is derived from operational intelligence at Garnet Grid Consulting. For mobile engineering consulting, visit garnetgrid.com. :::

Jakub Dimitri Rezayev
Jakub Dimitri Rezayev
Founder & Chief Architect • Garnet Grid Consulting

Jakub holds an M.S. in Customer Intelligence & Analytics and a B.S. in Finance & Computer Science from Pace University. With deep expertise spanning D365 F&O, Azure, Power BI, and AI/ML systems, he architects enterprise solutions that bridge legacy systems and modern technology — and has led multi-million dollar ERP implementations for Fortune 500 supply chains.

View Full Profile →