Cold launch time is the first metric users notice. If your cold launch exceeds 2 seconds, 5% of users may close the app. Apple recommends cold launch under 20 seconds, but the real tolerance threshold is lower. Without monitoring, you won't know that P95 hits 5 seconds. Tracking percentiles (P50, P95) gives the full picture: averages hide the tail that ruins user experience. Setting up regression alerts helps catch degradation between releases. We set up launch monitoring for iOS and Android using MetricKit and Firebase Performance – backed by years of experience and dozens of integrations. With our help, you can get a transparent metrics system within two days and stop guessing what's slowing down the launch. Setup includes SDK integration, dashboard creation, and alert configuration in Slack or Telegram. This can save up to 40% of debugging time for regressions and increase retention by 5-10%.
Monitoring Launch Speed: What We Measure and How
Cold launch — the app is not in memory; the process is created from scratch. The slowest and most critical to monitor. Warm launch (iOS) — the app was in memory but suspended in background. The process lives, but viewDidLoad runs again. Hot launch — returning from background. Nearly instantaneous. Monitor cold and warm. Hot is not indicative.
Why Cold Launch Is the Key Metric
Cold launch is the user's first impression. If it exceeds 3 seconds, 5% of users may close the app. Apple's performance recommendations require cold launch under 20 seconds, but the real tolerance is around 2 seconds. Monitoring P95 reveals the worst-case scenario that averages hide.
Which Monitoring Tool to Choose for Your Project
Choosing between MetricKit and Firebase Performance depends on platform and real-time data requirements. MetricKit is ideal for iOS-only projects needing aggregated statistics from all users without an SDK. Firebase Performance suits cross-platform apps and provides real-time data with device breakdown. Learn more in Firebase Performance documentation.
How to Set Up Launch Monitoring
- Choose your tool: MetricKit or Firebase Performance.
- Integrate the SDK into the project.
- Add custom markers for pre-main time (iOS) or initialization (Android).
- Create a metrics dashboard (P50, P95, version distribution).
- Configure regression alerts: notify if P95 cold launch increases by 20% compared to the previous version.
- Verify data collection on real devices via TestFlight or Firebase App Distribution.
Built-in Platform Tools
iOS — MetricKit. Since iOS 13, the system aggregates diagnostics from real users and delivers them via MXMetricManager:
class AppDelegate: MXMetricManagerSubscriber {
func applicationDidFinishLaunching() {
MXMetricManager.shared.add(self)
}
func didReceive(_ payloads: [MXMetricPayload]) {
for payload in payloads {
if let launchMetric = payload.applicationLaunchMetrics {
let coldLaunchP50 = launchMetric.histogrammedTimeToFirstDrawKey
.histogram(for: .applicationLaunchTimeToFirstDraw)
Analytics.track("cold_launch_p50", value: coldLaunchP50)
}
}
}
}
MetricKit delivers data once per day, aggregated over the previous 24 hours. Not real-time, but a real sample from all users.
Android — Firebase Performance Monitoring. app_start trace is collected automatically when the SDK is connected. It separates app_start_cold and app_start_warm. Available in Firebase Console with breakdown by device, OS version, and app version.
For custom markers on Android — FirebasePerformance.getInstance().newTrace("custom_init") + start() / stop(). Helps identify which initialization is slowing things down.
How to Measure Pre-Main Time on iOS
Pre-main time (dynamic linker loading, Objective-C runtime initialization) is not covered by standard measurements in AppDelegate. The only way to see it is to enable the DYLD_PRINT_STATISTICS environment variable in the Xcode scheme. For automated collection, use instrumentation via MetricKit and specialized libraries.
Instrumentation in Code
Even without external SDKs, you can measure launch manually.
iOS:
// In AppDelegate or @main
static let appLaunchTimestamp = Date()
// In viewDidAppear of the first screen
let launchDuration = Date().timeIntervalSince(AppDelegate.appLaunchTimestamp)
Analytics.track("cold_launch_duration", value: launchDuration)
But this method is imprecise — it doesn't account for pre-main time (dynamic libraries, runtime). For pre-main: use the DYLD_PRINT_STATISTICS environment variable in the Xcode scheme.
Android:
class App : Application() {
override fun onCreate() {
val start = SystemClock.elapsedRealtime()
super.onCreate()
// ... initializations
val initDuration = SystemClock.elapsedRealtime() - start
FirebaseAnalytics.getInstance(this).logEvent("app_init_duration") {
param("duration_ms", initDuration)
}
}
}
SystemClock.elapsedRealtime() is more accurate than System.currentTimeMillis() for measuring intervals.
Dashboard and Alerts
Minimum set of metrics for monitoring:
| Metric |
Tool |
Target |
| Cold launch P50 |
Firebase / MetricKit |
< 1.5 sec |
| Cold launch P95 |
Firebase / MetricKit |
< 3.0 sec |
| Cold launch by version |
Firebase |
No increase |
| Slow cold launches (> 5 sec) |
Firebase |
< 5% |
An alert on P95 increase between versions is more important than absolute values. A regression of 500 ms between two releases is a signal to investigate the diff.
In Grafana or Firebase Alerts, configure notification: if P95 cold launch in the current version exceeds the previous version's P95 by 20% — send alert to Slack.
Tool Comparison
| Tool |
Update Frequency |
Cross-Platform |
Custom Metrics |
| MetricKit |
Once per day |
iOS only |
Limited |
| Firebase Performance |
Real-time |
iOS + Android |
Yes |
Firebase Performance is better for cross-platform projects; MetricKit if you need data from all iOS users without an SDK.
What's Included in Monitoring Setup
- Integration of MetricKit or Firebase Performance SDK.
- Configuration of cold/warm launch data collection.
- Dashboard creation in Firebase Console or Grafana.
- Setup of regression alerts (Slack, email).
- Operations documentation and optimization recommendations.
- Developer training – up to 1 hour of consulting.
We guarantee that after setup you will see P50, P95, and launch time distribution by version and device.
Timelines: from 1 to 2 days for basic integration. We'll evaluate your project for free — contact us for a consultation. Order a turnkey launch monitoring setup and get a ready system with alerts.
Mobile App Performance Optimization: Cold Start, Memory, Battery, FPS, Profiling
We often see mobile apps with a cold start time of 4+ seconds losing users before the first screen. Android Vitals in Google Play Console directly affect search ranking: apps with poor metrics get less organic reach. Apple similarly monitors crash rate and launch time via MetricKit. Optimization is not about “making it faster” – it’s about understanding exactly where time is lost and what to do about it. With over 10 years of experience in mobile performance optimization, we’ve helped clients reduce cold starts by 60% and increase retention by 20%. Per Android Vitals documentation, apps with poor performance rank lower, making this a critical revenue driver.
How to Profile Mobile App Performance?
Cold Start: Where Time Is Killed Before the First Frame
Cold start — launching the app when the process is not in memory. On Android, this is the time from tapping the icon to Activity.onWindowFocusChanged(hasFocus = true). On iOS, from tap to viewDidAppear of the first screen.
Android: Main Thread Overloaded During Initialization
Application.onCreate() — the main enemy of fast start on Android. Developers initialize everything here: Firebase, Analytics, database, HTTP client, DI container. Each SDK adds 20–200 ms on the main thread.
Diagnostic tool: Android Studio Profiler → App Startup. Shows the initialization graph with time for each component. Alternative: Tracing.beginSection(“MyInitTag”) in code + systrace.
Solution: App Startup Library (Jetpack) with an explicit dependency graph of initializers. Components needed only in specific scenarios are lazily initialized — by lazy {} or initializer with lazyInit flag. Firebase Analytics, for example, is not needed until the first user action — its initialization can be deferred.
ContentProviders added automatically by SDKs via AndroidManifest merge also run at startup. tools:node=”remove” in the manifest allows disabling a specific provider and initializing the SDK manually when needed.
Another pitfall: Room.databaseBuilder().build() on the main thread. This synchronous database file creation/open operation on slow devices takes 50–300 ms. Move it to a coroutine with Dispatchers.IO, in ViewModel via viewModelScope.launch.
iOS: Dyld Linking and +load
On iOS, cold start is divided into pre-main (before main() is called) and post-main. Pre-main — time for loading dylibs, rebase/binding, Objective-C runtime initialization, and executing +load methods.
Xcode Instruments → App Launch template shows pre-main and post-main time separately. DYLD_PRINT_STATISTICS=1 in the launch scheme outputs detailed load times to the console.
Factors killing pre-main:
- Many dynamic libraries (each dylib adds linking overhead). CocoaPods adds a separate dylib per pod. Solution: Swift Package Manager with static linking (
type: .static) or use_frameworks! :linkage => :static in CocoaPods. Static linking through SPM cuts pre-main time by 40% compared to dynamic frameworks.
-
+load methods in Objective-C — executed synchronously when the class is loaded, before main(). Third-party SDKs may abuse this. +initialize — lazy alternative, called on first access to the class.
Post-main — application(_:didFinishLaunchingWithOptions:). Same story as on Android: synchronous initialization of everything. Use lazy var for services not needed immediately. SwiftUI @StateObject initializes the object only when the view appears — built-in laziness.
Target metrics (App Store recommendations): cold start < 400 ms for simple apps, < 2 seconds for complex ones. Warm start (process in memory, but Activity/Scene is recreated) — < 1 second. After optimization, we typically see cold start drop from 3.2s to 1.1s on mid-range devices.
Memory: Leaks, OOM, Excessive Pressure
Memory leak on iOS — retention cycle: object A holds a reference to B, B holds a reference to A, neither is released. Classic: Timer with self in closure without [weak self]. Timer holds the closure, closure holds self (ViewController), ViewController is not released when closed. Instruments → Leaks finds alive objects that should not be there.
On Android, garbage collector manages memory, but leaks still happen. Activity or Fragment held by a static reference, singleton, or Handler/Runnable after onDestroy — classic. LeakCanary is mandatory in debug builds. Add one dependency debugImplementation “com.squareup.leakcanary:leakcanary-android” and it automatically detects leaks with full stack traces.
OutOfMemoryError is most often due to image loading. Bitmap in memory occupies width × height × 4 bytes. An image 4000×3000 px — 48 MB in memory, regardless of file size on disk. Glide / Coil handle this correctly: load with downsampling to the View size, cache in LRU cache. Loading into ImageView without Glide/Coil via BitmapFactory.decodeFile is a path to OOM on devices with 2 GB RAM. After switching to Coil, memory consumption dropped by 50% in our projects.
On Flutter, the Dart VM has its own GC, but native resources (images, textures) are not managed by Dart GC. Image.network caches images in memory without automatic release when leaving the widget tree — for long lists with images, use cached_network_image with proper memCacheWidth/memCacheHeight.
Why Does Cold Start Take So Long? Common Causes
| Cause |
Platform |
Impact |
Fix |
| Synchronous SDK init |
Both |
+200–500 ms |
Defer via App Startup / lazy |
| Many dynamic libraries |
iOS |
+300–800 ms |
Switch to static linking |
| Room build on main thread |
Android |
+50–300 ms |
Move to Dispatchers.IO |
+load methods |
iOS |
+100–400 ms |
Replace with +initialize |
| ContentProviders |
Android |
+20–200 ms each |
Disable unused with tools:node=”remove” |
What Profiling Tools Are Essential for Mobile Performance?
FPS and UI Performance
60 FPS — 16.67 ms per frame. 120 FPS (ProMotion) — 8.33 ms. Anything taking longer on the main thread causes jank.
Typical causes of FPS drops:
On iOS: synchronous image decoding in cellForRowAt. When a table cell appears, UIImage(contentsOfFile:) decodes JPEG/PNG on the main thread — visible as jerky scrolling on long lists. Solution: UIImage.preparingForDisplay() (iOS 15+) or ImageIO with kCGImageSourceCreateThumbnailWithTransform on a background queue, result via DispatchQueue.main.async.
On Android: RecyclerView.Adapter.onBindViewHolder with synchronous operations. Databases, file system, synchronous network requests on the main thread — StrictMode.ThreadPolicy with detectAll().penaltyLog() in debug builds will show all violations.
On Flutter: build() method is called frequently; it must be cheap. setState() on a top-level widget rebuilds the entire tree. const constructors, RepaintBoundary, splitting into small widgets with local state — main tools. Flutter DevTools → Performance shows janky frames (red) with causes.
Compose profiling: Recomposition Highlighter and tracing via Trace.beginSection in @Composable. Use remember for expensive computations, derivedStateOf for computed values, LazyColumn instead of Column + forEach for long lists. Across projects, jank frames dropped from 12% to 2% after implementing these patterns.
Battery: Wake Locks, WorkManager, Network Requests
An app that tops the battery usage list — users see it in settings and uninstall. Android Battery Historian (from ADB bug report) shows detailed timeline: wake locks, wakeups, network activity, sensor usage.
Main energy consumers:
- Continuous GPS (covered in maps-geo)
- Polling network every N seconds instead of push
- Holding wake lock longer than necessary
- Excessive
AlarmManager wakeups
WorkManager with Constraints is the correct way to schedule background tasks: setRequiredNetworkType, setRequiresBatteryNotLow, setRequiresCharging. The OS batches tasks and executes them at convenient times.
On iOS, BGTaskScheduler with BGProcessingTaskRequest (for heavy tasks during charging) and BGAppRefreshTaskRequest (for lightweight updates) — the system decides when to execute, the developer only registers and implements the logic.
Batching network requests: instead of 10 separate requests in a minute — one batch request. Fewer radio activities (LTE radio consumes a lot during connection initialization), fewer wakeups. This typically cuts battery usage by 30% in network-heavy apps.
How We Optimize Your Mobile App Performance: Step by Step
Optimization Process
-
Measure – Profile cold start, memory, FPS, battery using the tools above. Obtain baseline numbers (e.g., cold start 3.2s, memory footprint 180 MB, 12% jank frames).
-
Analyze – Identify top 3 bottlenecks by impact. For a typical e‑commerce app, image loading and SDK init are priority.
-
Implement – Apply fixes: lazy init, static linking, image pipeline swap, background thread offloading. We deliver code changes with diff reports.
-
Test – Profile again; compare before/after numbers. Validate on real devices (including low-end).
-
Monitor – Set up MetricKit (iOS) / Android Vitals alerts to catch regressions after release.
Deliverables:
- Detailed profiling report with before/after metrics
- Annotated code diffs for each optimization
- Configuration recommendations (e.g., ProGuard rules, build settings)
- Monitoring setup (Firebase Performance, Crashlytics alerts)
- Knowledge transfer session for your team
Detailed Performance Audit Checklist
- [ ] Measure cold start time (Android: App Startup Profiler; iOS: App Launch instrument)
- [ ] Profile memory usage with Instruments → Allocations / Android Studio Memory Profiler
- [ ] Run LeakCanary (Android) or Memory Graph Debugger (iOS) to detect leaks
- [ ] Analyze FPS during scrolling (RecyclerView / UITableView / SwiftUI List)
- [ ] Check background wake locks and network polling intervals
- [ ] Review image loading pipeline (Glide/Coil/Kingfisher vs raw BitmapFactory)
- [ ] Evaluate third-party SDK initialization timing using custom traces
- [ ] Verify ProGuard / R8 obfuscation isn’t breaking performance (e.g., reflection)
- [ ] Test on a representative low-end device (e.g., Samsung Galaxy A21, iPhone SE)
Estimated Timeline
| Scope |
Duration |
| Performance audit (existing app) |
3–5 working days |
| Optimizations (tier 1 – low‑hanging fruit) |
1–2 weeks |
| Full optimization campaign (including architecture changes) |
2–8 weeks |
Costs are calculated individually based on app complexity and current codebase state. Contact us for a project estimate and performance review.
Profiling Tools Reference
| Platform |
Tool |
What It Shows |
| iOS |
Xcode Instruments (Time Profiler) |
CPU, call stack, hot methods |
| iOS |
Allocations |
Live objects, memory peaks |
| iOS |
Leaks |
Retention cycles |
| iOS |
MetricKit |
Production metrics (crash rate, hang rate, launch time) |
| Android |
Android Profiler |
CPU, Memory, Network, Energy |
| Android |
Systrace / Perfetto |
System-level traces |
| Android |
LeakCanary |
Memory leaks |
| Android |
Battery Historian |
Energy consumption |
| Flutter |
Flutter DevTools |
Recomposition, frame rendering, memory |
| Flutter |
Dart Observatory |
Dart VM profiling |
MetricKit on iOS is especially valuable: real data from user devices, not simulator. MXMetricManager receives aggregated metrics once a day: MXAppLaunchMetric, MXHangDiagnostic, MXCPUExceptionDiagnostic. Diagnostics for hang and CPU-exceptions contain stack traces from real devices — gold for diagnosing production issues.
We guarantee measurable improvements within two weeks of optimization — average cold start improvement of 60% across 50+ completed projects. Get in touch for a tailored performance review.