Optimize mobile application performance covering startup time, rendering efficiency, memory management, battery consumption, and network performance across iOS and Android.
You are a mobile performance engineer who specializes in identifying and resolving performance bottlenecks in production mobile applications. Create a comprehensive performance optimization plan for the following application. App Details: App Name: [APP NAME] Framework: [NATIVE iOS/NATIVE ANDROID/REACT NATIVE/FLUTTER] App Size: [CURRENT APK/IPA SIZE] Startup Time: [CURRENT COLD START TIME] Known Issues: [JANK/SLOW STARTUP/MEMORY LEAKS/BATTERY DRAIN/LARGE APP SIZE] User Complaints: [SPECIFIC PERFORMANCE COMPLAINTS] Target Devices: [FLAGSHIP ONLY/MID-RANGE/LOW-END INCLUDED] Section 1 - App Startup Optimization: Analyze the cold start, warm start, and hot start paths identifying the phases of startup including process creation, application initialization, first frame rendering, and interactive readiness. Define the startup time budget allocating millisecond targets for each phase with a total cold start goal appropriate for the app category typically under two seconds on mid-range devices. Specify the lazy initialization strategy for deferring non-critical SDK initialization, database migrations, and background service setup until after the first interactive frame. Create the splash screen optimization using the modern SplashScreen API on Android 12 and above and the appropriate launch storyboard on iOS that provides instant visual feedback. Address the startup profiling methodology using Android Studio Profiler, Xcode Instruments, or React Native and Flutter specific tools to identify the exact operations consuming startup time. Section 2 - Rendering Performance and UI Smoothness: Define the frame rate targets ensuring 60 frames per second for standard interactions and 120 frames per second on ProMotion and high-refresh-rate displays with specific jank budgets per frame. Identify the common rendering bottlenecks including overdraw, unnecessary view hierarchy depth, expensive layout calculations, and synchronous main thread operations. Create the list scrolling optimization strategy using recycling views on Android with RecyclerView and DiffUtil, SwiftUI List optimizations, FlashList in React Native, or ListView.builder in Flutter with proper item extent specifications. Specify the image rendering optimization including appropriate image sizing, format selection between WebP AVIF and platform native formats, progressive loading, and off-screen image recycling. Address the animation performance guidelines including when to use hardware-accelerated layers, how to avoid layout thrashing during animations, and how to profile animation performance using platform developer tools. Section 3 - Memory Management and Leak Prevention: Define the memory budget for the application based on target device capabilities with separate budgets for foreground and background states. Specify the memory leak detection methodology using LeakCanary on Android, Instruments Allocations on iOS, or framework-specific tools to identify retained objects and reference cycles. Create the image memory management strategy including bitmap pooling, downsampling large images to display size, and clearing image caches during memory pressure events. Design the large dataset handling approach for screens displaying hundreds or thousands of items using windowed data loading and view recycling. Address the background memory management including reducing memory footprint when the app moves to the background, responding to system memory warnings, and preventing the system from killing the app process. Section 4 - Network Performance Optimization: Define the network request optimization strategy including request batching, payload compression using gzip or brotli, and response caching with appropriate cache-control headers. Specify the image and media download optimization using progressive JPEG loading, resolution negotiation based on device screen density and network speed, and prefetching strategies for content the user is likely to view next. Create the API response pagination strategy using cursor-based pagination for infinite scroll interfaces with predictive prefetching that loads the next page before the user reaches the end. Design the network retry and timeout strategy with circuit breaker patterns that prevent overwhelming failing servers and provide graceful degradation. Address the cellular data efficiency measures including detecting metered connections, offering data saver modes, and estimating data consumption for user transparency. Section 5 - Battery and Energy Optimization: Define the energy budget considering CPU usage, GPU usage, network radio activity, and location service consumption as the primary battery-draining factors. Specify the background processing optimization using efficient scheduling through WorkManager on Android and BGTaskScheduler on iOS with appropriate intervals and conditions. Create the location tracking efficiency strategy using significant location changes for coarse tracking, geofencing for area-based triggers, and activity recognition to adjust tracking frequency based on user movement. Design the network radio optimization that batches network requests to minimize radio wake-ups and uses push notifications instead of polling for real-time updates. Address the energy profiling methodology using Xcode Energy Impact gauge, Android Vitals battery usage data, and the specific patterns that cause excessive energy consumption. Section 6 - App Size Reduction and Monitoring: Define the app size reduction strategy including asset optimization, code shrinking with R8 or bitcode, on-demand resource delivery using Android App Bundles and iOS On-Demand Resources, and removing unused dependencies. Specify the bundle analysis approach to identify the largest contributors to app size including native libraries, images, fonts, and embedded assets. Create the performance monitoring and alerting system using Firebase Performance Monitoring, Sentry, or custom telemetry that tracks key metrics in production including startup time distribution, frame rate percentiles, network request latency, and crash-free session rate. Design the performance regression prevention process including automated performance tests in the CI/CD pipeline with baseline comparisons and budget enforcement. Address the A/B testing approach for measuring the user impact of performance improvements including retention correlation, session length changes, and conversion rate improvements tied to specific optimizations.
Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[APP NAME][CURRENT COLD START TIME][SPECIFIC PERFORMANCE COMPLAINTS]